Trait slab_alloc::BackingAlloc [] [src]

pub trait BackingAlloc {
    type Aligned: UntypedObjectAlloc;
    type Large: UntypedObjectAlloc;
}

A pair of UntypedObjectAllocs to provide memory for a slab allocator.

A BackingAlloc encapsulates a pair of allocator types that are used to provide the memory needed to construct the slabs used by a slab allocator. Under the hood, slab allocators use two different types of slabs - "aligned" slabs and "large" slabs - with different requirements for backing memory. A BackingAlloc provides an allocator for each of the two slab types.

Associated Types

An allocator for aligned slabs.

An Aligned allocator allocates the memory for aligned slabs. All memory allocated by this allocator must have an alignment which is equal to its size. An Aligned allocator must be capable of allocating page-sized blocks of memory. Smaller or larger blocks of memory are not required to be supported. Allocated memory should be uninitialized.

An allocator for large slabs.

A Large allocator allocates the memory for large slabs. All memory allocated by this allocator must be page-aligned; a Large allocator will never be constructed with an object size smaller than the page size. All sizes larger than or equal to a page size must be supported. Allocated memory should be uninitialized.

Implementors