Trait simple_allocator_trait::Allocator[][src]

pub trait Allocator {
    fn allocate<T>(capacity: usize) -> *mut T;
unsafe fn deallocate<T>(ptr: *mut T, capacity: usize); }

A trait for all allocators that collections can be generic about

Required Methods

Allocate enough memory to store capacity of T

Free previously allocated memory from pointer.

Undefined behaviour when passed something else than a pointer that was created in a call of allocate, or when passing a differing capacity

Implementors