[][src]Module basic_allocator::allocators

Basic allocator types, both generic and Unix-specific.

Basic Types

RawAlloc

A RawAlloc is a single-threaded, non-thread-safe heap and freed memory manager, implementing core::alloc::GlobalAlloc. However, because it is not thread-safe, it canot be used as a global allocator.BlockList

UnixAllocator

A UnixAllocator wraps RawAlloc with a spin lock to make it thread-safe, allowing it to be used as the global allocator. It also combines RawAlloc with a unix-specific UnixHeapGrower to use virtual memory pages as its underlying basis for making those calls.

HeapGrower

HeapGrower is a simple trait interface meant to abstract over the calls to the OS to expand the heap.

ToyHeap

ToyHeap is a static array on the stack that can pretend to be a heap, and implements HeapGrower for such a purpose. It is mainly useful for testing.

Structs

GenericAllocator

A thread-safe allocator, using a spin lock around a RawAlloc.

RawAlloc

A raw allocator, capable of growing the heap, returning pointers to new allocations, and tracking and reusing freed memory.

SyscallHeapGrower

SyscallHeapGrower uses virtual memory to grow the heap upon request.

ToyHeap
ToyHeapOverflowError
UnixAllocator

Traits

HeapGrower