Struct rquickjs_core::RustAllocator
source · [−]pub struct RustAllocator;
Expand description
The allocator which uses Rust global allocator
Trait Implementations
sourceimpl Allocator for RustAllocator
impl Allocator for RustAllocator
sourcefn alloc(&mut self, size: usize) -> RawMemPtr
fn alloc(&mut self, size: usize) -> RawMemPtr
Available on crate feature
allocator
only.Allocate new memory
sourcefn dealloc(&mut self, ptr: RawMemPtr)
fn dealloc(&mut self, ptr: RawMemPtr)
Available on crate feature
allocator
only.De-allocate previously allocated memory
sourcefn realloc(&mut self, ptr: RawMemPtr, new_size: usize) -> RawMemPtr
fn realloc(&mut self, ptr: RawMemPtr, new_size: usize) -> RawMemPtr
Available on crate feature
allocator
only.Re-allocate previously allocated memory
sourcefn usable_size(ptr: RawMemPtr) -> usize
fn usable_size(ptr: RawMemPtr) -> usize
Available on crate feature
allocator
only.Get usable size of allocated memory region
Auto Trait Implementations
impl RefUnwindSafe for RustAllocator
impl Send for RustAllocator
impl Sync for RustAllocator
impl Unpin for RustAllocator
impl UnwindSafe for RustAllocator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more