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

#16 in #page

Download history 25/week @ 2023-10-28 39/week @ 2023-11-04 29/week @ 2023-11-11 48/week @ 2023-11-18 34/week @ 2023-11-25 43/week @ 2023-12-02 33/week @ 2023-12-09 37/week @ 2023-12-16 22/week @ 2023-12-23 19/week @ 2023-12-30 36/week @ 2024-01-06 61/week @ 2024-01-13 46/week @ 2024-01-20 109/week @ 2024-01-27 203/week @ 2024-02-03 254/week @ 2024-02-10

621 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