#[repr(C)]pub struct yyjson_alc {
pub malloc: Option<unsafe extern "C" fn(ctx: *mut c_void, size: usize) -> *mut c_void>,
pub realloc: Option<unsafe extern "C" fn(ctx: *mut c_void, ptr: *mut c_void, old_size: usize, size: usize) -> *mut c_void>,
pub free: Option<unsafe extern "C" fn(ctx: *mut c_void, ptr: *mut c_void)>,
pub ctx: *mut c_void,
}
Expand description
A memory allocator.
Typically you don’t need to use it, unless you want to customize your own memory allocator.
Fields§
§malloc: Option<unsafe extern "C" fn(ctx: *mut c_void, size: usize) -> *mut c_void>
Same as libc’s malloc(size), should not be NULL.
realloc: Option<unsafe extern "C" fn(ctx: *mut c_void, ptr: *mut c_void, old_size: usize, size: usize) -> *mut c_void>
Same as libc’s realloc(ptr, size), should not be NULL.
free: Option<unsafe extern "C" fn(ctx: *mut c_void, ptr: *mut c_void)>
Same as libc’s free(ptr), should not be NULL.
ctx: *mut c_void
A context for malloc/realloc/free, can be NULL.
Trait Implementations§
Source§impl Clone for yyjson_alc
impl Clone for yyjson_alc
Source§fn clone(&self) -> yyjson_alc
fn clone(&self) -> yyjson_alc
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for yyjson_alc
impl Debug for yyjson_alc
impl Copy for yyjson_alc
Auto Trait Implementations§
impl Freeze for yyjson_alc
impl RefUnwindSafe for yyjson_alc
impl !Send for yyjson_alc
impl !Sync for yyjson_alc
impl Unpin for yyjson_alc
impl UnwindSafe for yyjson_alc
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