[−][src]Struct mmap_allocator::MmapAllocator
Implementation of std::alloc::GlobalAlloc whose backend is mmap(2)
Implementations
impl MmapAllocator
[src]
Trait Implementations
impl Clone for MmapAllocator
[src]
fn clone(&self) -> MmapAllocator
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MmapAllocator
[src]
impl Debug for MmapAllocator
[src]
impl Default for MmapAllocator
[src]
impl GlobalAlloc for MmapAllocator
[src]
Portability
alloc() calls mmap() with flag MAP_ANONYMOUS. Many systems support the flag, however, it is not specified in POSIX.
Safety
All functions are thread safe.
Error
Each function don't cause panic but set OS errno on error.
Note that it is not an error to deallocate pointer which is not allocated.
This is the spec of munmap(2). See man 2 munmap
for details.
unsafe fn alloc(&self, layout: Layout) -> *mut u8
[src]
Panics
This method may panic if the align of layout
is greater than the kernel page align.
(Basically, kernel page align is always greater than the align of layout
that rust
generates unless the programer dares to build such a layout
on purpose.)
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
[src]
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
[src]
Panics
This method can panic if the align of layout
is greater than the kernel page align.
unsafe fn realloc(
&self,
ptr: *mut u8,
layout: Layout,
new_size: usize
) -> *mut u8
1.28.0[src]
&self,
ptr: *mut u8,
layout: Layout,
new_size: usize
) -> *mut u8
Auto Trait Implementations
impl RefUnwindSafe for MmapAllocator
impl Send for MmapAllocator
impl Sync for MmapAllocator
impl Unpin for MmapAllocator
impl UnwindSafe for MmapAllocator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,