Struct std::os::MemoryMapExperimental
[-]
[+]
[src]
pub struct MemoryMap { // some fields omitted }
A memory mapped file or chunk of memory. This is a very system-specific
interface to the OS's memory mapping facilities (mmap
on POSIX,
VirtualAlloc
/CreateFileMapping
on Windows). It makes no attempt at
abstracting platform differences, besides in error values returned. Consider
yourself warned.
The memory map is released (unmapped) when the destructor is run, so don't let it leave scope by accident if you want it to stick around.
Methods
impl MemoryMap
fn new(min_len: uint, options: &[MapOption]) -> Result<MemoryMap, MapError>
Create a new mapping with the given options
, at least min_len
bytes long.
fn granularity() -> uint
Granularity of MapAddr() and MapOffset() parameter values. This may be greater than the value returned by page_size().
impl MemoryMap
fn data(&self) -> *mut u8
Returns the pointer to the memory created or modified by this map.
fn len(&self) -> uint
Returns the number of bytes this map applies to.
fn kind(&self) -> MemoryMapKind
Returns the type of mapping this represents.
Trait Implementations
impl Drop for MemoryMap
fn drop(&mut self)
Unmap the mapping. Panics the task if any of VirtualFree
,
UnmapViewOfFile
, or CloseHandle
fail.