7 unstable releases

0.4.1 May 26, 2025
0.4.0 Feb 15, 2024
0.3.0 Feb 8, 2024
0.2.2 Jan 15, 2024
0.1.0 Jun 2, 2021

#204 in Unix APIs

Download history 1164/week @ 2025-12-11 760/week @ 2025-12-18 280/week @ 2025-12-25 870/week @ 2026-01-01 1117/week @ 2026-01-08 1079/week @ 2026-01-15 1515/week @ 2026-01-22 1686/week @ 2026-01-29 2120/week @ 2026-02-05 1428/week @ 2026-02-12 1580/week @ 2026-02-19 2256/week @ 2026-02-26 2562/week @ 2026-03-05 1835/week @ 2026-03-12 1935/week @ 2026-03-19 2096/week @ 2026-03-26

9,027 downloads per month
Used in 10 crates (5 directly)

Custom license

15KB
106 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

~1.5–5.5MB
~131K SLoC