6 releases

0.3.0 Oct 11, 2023
0.2.0 Sep 13, 2023
0.1.3 Sep 11, 2023
0.1.0 Aug 30, 2023

#17 in #memory-region

Download history 11/week @ 2024-07-04 15/week @ 2024-07-11 9/week @ 2024-07-18 10/week @ 2024-07-25 13/week @ 2024-08-01 14/week @ 2024-08-08 23/week @ 2024-08-15 12/week @ 2024-08-22 14/week @ 2024-08-29 21/week @ 2024-09-05 19/week @ 2024-09-12 33/week @ 2024-09-19 73/week @ 2024-09-26 48/week @ 2024-10-03 59/week @ 2024-10-10 64/week @ 2024-10-17

255 downloads per month
Used in 2 crates (via piecrust)

MPL-2.0 license

31KB
544 lines

Library for creating and managing copy-on-write memory-mapped regions.

The core functionality is offered by the Mmap struct, which is a read-write memory region that keeps track of which pages have been written to.

Example

use crumbles::Mmap;

let mut mmap = Mmap::new(65536, 65536)?;

// When first created, the mmap is not dirty.
assert_eq!(mmap.dirty_pages().count(), 0);

mmap[24] = 42;
// After writing a single byte, the page it's on is dirty.
assert_eq!(mmap.dirty_pages().count(), 1);

Limitations

This crate currently only builds for 64-bit Unix targets. This is because it relies on various features of libc which are not available in other targets.

Dependencies

~260KB