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

#644 in Unix APIs

Download history 49/week @ 2024-11-15 43/week @ 2024-11-22 67/week @ 2024-11-29 76/week @ 2024-12-06 68/week @ 2024-12-13 23/week @ 2024-12-20 2/week @ 2024-12-27 30/week @ 2025-01-03 56/week @ 2025-01-10 180/week @ 2025-01-17 146/week @ 2025-01-24 176/week @ 2025-01-31 133/week @ 2025-02-07 60/week @ 2025-02-14 142/week @ 2025-02-21 72/week @ 2025-02-28

432 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
~147K SLoC