Skip to main content

Memory

Trait Memory 

Source
pub trait Memory {
    // Required methods
    fn allocate<T>(&self, value: T) -> *mut T;
    unsafe fn deallocate<T>(&self, pointer: *mut T);
}
Expand description

A type that can allocate and deallocate memory.

Required Methods§

Source

fn allocate<T>(&self, value: T) -> *mut T

Allocates memory.

Source

unsafe fn deallocate<T>(&self, pointer: *mut T)

Deallocates the memory associated with the supplied pointer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§