Crate slabmalloc
source ·Expand description
A slab allocator implementation for objects less than 8KiB.
Overview
The organization is as follows:
- A
ZoneAllocator
manages manySCAllocator
and can satisfy requests for different allocation sizes. - A
SCAllocator
allocates objects of exactly one size. It stores the objects and meta-data in one or multipleAllocablePage
objects. - A trait
AllocablePage
that defines the page-type from which we allocate objects.
Lastly, it provides a default AllocablePage
implementations ObjectPage8k
that is 8 KiB in size
and contains allocated objects and associated meta-data
Structs
- A wrapper type around MappedPages which ensures that the MappedPages have a size and alignment of 8 KiB and are writable.
- Holds allocated data within 2 4-KiB pages.
- Rawlink is a type like
Option<T>
but for holding a raw pointer. - A zone allocator for arbitrary sized allocations.
Traits
- This trait is used to define a page from which objects are allocated in an
SCAllocator
.