pub struct Allocator {
pub malloc: unsafe extern "C" fn(size: usize) -> *mut c_void,
pub calloc: unsafe extern "C" fn(nmemb: usize, size: usize) -> *mut c_void,
pub realloc: unsafe extern "C" fn(ptr: *mut c_void, size: usize) -> *mut c_void,
pub free: unsafe extern "C" fn(ptr: *mut c_void),
}Expand description
A complete set of memory allocation functions for the core C library.
Fields§
§malloc: unsafe extern "C" fn(size: usize) -> *mut c_void§calloc: unsafe extern "C" fn(nmemb: usize, size: usize) -> *mut c_void§realloc: unsafe extern "C" fn(ptr: *mut c_void, size: usize) -> *mut c_void§free: unsafe extern "C" fn(ptr: *mut c_void)Trait Implementations§
Auto Trait Implementations§
impl Freeze for Allocator
impl RefUnwindSafe for Allocator
impl Send for Allocator
impl Sync for Allocator
impl Unpin for Allocator
impl UnsafeUnpin for Allocator
impl UnwindSafe for Allocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more