6 releases (3 breaking)

0.4.0 Feb 15, 2024
0.3.0 Feb 8, 2024
0.2.2 Jan 15, 2024
0.2.1 Dec 13, 2022
0.1.0 Jun 2, 2021

#344 in Unix APIs

Download history 8/week @ 2024-07-22 105/week @ 2024-07-29 549/week @ 2024-08-05 210/week @ 2024-08-12 52/week @ 2024-08-19 63/week @ 2024-08-26 74/week @ 2024-09-02 146/week @ 2024-09-09 79/week @ 2024-09-16 147/week @ 2024-09-23 103/week @ 2024-09-30 124/week @ 2024-10-07 84/week @ 2024-10-14 55/week @ 2024-10-21 97/week @ 2024-10-28 70/week @ 2024-11-04

308 downloads per month

Custom license

15KB
126 lines

DMA-Buf Heap Helper Library

The DMA-Buf Heap interface in Linux is aimed at providing a way for the user-space to allocate memory buffers that can be efficiently shared between multiple devices through the DMA-Buf mechanism. It aims at superseeding the ION Interface previously found in Android.

This library provides a safe abstraction over this interface for Rust.

Hello World

use std::os::unix::io::OwnedFd;
use dma_heap::{Heap, HeapKind};

let heap = Heap::new(HeapKind::Cma)
    .unwrap();

// Buffer will automatically be freed when `buffer` goes out of scope.
let buffer: OwnedFd = heap.allocate(1024).unwrap();

Dependencies

~2–11MB
~128K SLoC