Trait rquickjs_core::Allocator
source · [−]pub trait Allocator {
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
Re-allocate previously allocated memory
fn usable_size(ptr: RawMemPtr) -> usize where
Self: Sized,
fn usable_size(ptr: RawMemPtr) -> usize where
Self: Sized,
Get usable size of allocated memory region