Skip to content

Instantly share code, notes, and snippets.

View mkeeter's full-sized avatar

Matt Keeter mkeeter

View GitHub Profile
pub struct Mmap {
ptr: *mut libc::c_void,
len: usize,
}
impl Mmap {
pub fn new(len: usize) -> Result<Self, std::io::Error> {
let ptr = unsafe {
libc::mmap(
std::ptr::null_mut(),