rust-lang / rfcs

RFCs for changes to Rust
https://rust-lang.github.io/rfcs/
Apache License 2.0
5.96k stars 1.57k forks source link

add a low-level library for manipulating memory mappings, protection and locking #786

Open steveklabnik opened 9 years ago

steveklabnik commented 9 years ago

Issue by thestinger Saturday Sep 06, 2014 at 18:13 GMT

For earlier discussion, see https://github.com/rust-lang/rust/issues/17047

This issue was labelled with: A-libs, I-enhancement in the Rust repository


Rust should expose a portable implementation of the mmap, mprotect and mlock functionality (VirtualAlloc, VirtualProtect, VirtualLock on Windows). The current support for memory mapped files is very lacking. The low-level support should be exposed via unsafe functions, and then a new high-level wrapper can be written on top of it.

retep998 commented 9 years ago

First platform specific versions of these things should be written in the relative platform specific sys modules. Once they're both written, then we can improve the cross platform API.

kepexx commented 4 years ago

Any update on this?

retep998 commented 4 years ago

The current status is to just use https://github.com/danburkert/memmap-rs

Ekleog commented 4 years ago

FWIW, we found memmap-rs to be near-impossible to use safely for our usage, and thus we wrote https://github.com/standard-ai/shmem -- though it's not published on crates.io yet because we noticed the name was taken at the time of open-sourcing it and haven't taken the time to (most importantly) find a new name, change its name and publish it yet. If you're interested in it, feel free to leave a message on its issue tracker.

Maybe the API we chose might be to consider for such a concern, in addition to the API memmap-rs chose?