Crate slabmalloc
source ·Expand description
A slab allocator implementation for objects less than 8KiB.
Overview
The organization is as follows:
- A ZoneAllocatormanages manySCAllocatorand can satisfy requests for different allocation sizes.
- A SCAllocatorallocates objects of exactly one size. It stores the objects and meta-data in one or multipleAllocablePageobjects.
- A trait AllocablePagethat 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 likeOption<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 anSCAllocator.