Trait rquickjs_core::Allocator[][src]

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
; }
This is supported on crate feature allocator only.

The allocator interface

Required methods

fn alloc(&mut self, size: usize) -> RawMemPtr[src]

Allocate new memory

fn dealloc(&mut self, ptr: RawMemPtr)[src]

De-allocate previously allocated memory

fn realloc(&mut self, ptr: RawMemPtr, new_size: usize) -> RawMemPtr[src]

Re-allocate previously allocated memory

fn usable_size(ptr: RawMemPtr) -> usize where
    Self: Sized
[src]

Get usable size of allocated memory region

Loading content...

Implementors

impl Allocator for RustAllocator[src]

Loading content...