Struct rquickjs_core::allocator::RustAllocator
source · pub struct RustAllocator;
Expand description
The allocator which uses Rust global allocator
Trait Implementations§
source§impl Allocator for RustAllocator
impl Allocator for RustAllocator
source§fn alloc(&mut self, size: usize) -> RawMemPtr
fn alloc(&mut self, size: usize) -> RawMemPtr
Available on crate feature
allocator
only.Allocate new memory
source§fn dealloc(&mut self, ptr: RawMemPtr)
fn dealloc(&mut self, ptr: RawMemPtr)
Available on crate feature
allocator
only.De-allocate previously allocated memory
source§fn 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
source§fn 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§
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