Trait rquickjs_core::allocator::Allocator
source · pub trait Allocator {
// Required methods
fn alloc(&mut self, size: usize) -> RawMemPtr;
fn dealloc(&mut self, ptr: RawMemPtr);
fn realloc(&mut self, ptr: RawMemPtr, new_size: usize) -> RawMemPtr;
fn usable_size(ptr: RawMemPtr) -> usize
where Self: Sized;
}
Available on crate feature
allocator
only.Expand description
The allocator interface
Required Methods§
sourcefn realloc(&mut self, ptr: RawMemPtr, new_size: usize) -> RawMemPtr
fn realloc(&mut self, ptr: RawMemPtr, new_size: usize) -> RawMemPtr
Re-allocate previously allocated memory
sourcefn usable_size(ptr: RawMemPtr) -> usizewhere
Self: Sized,
fn usable_size(ptr: RawMemPtr) -> usizewhere
Self: Sized,
Get usable size of allocated memory region