![]() |
L4Re Operating System Framework
Interface and Usage Documentation
|
Merged slab allocator (allocators for objects of the same size are merged together). More...
#include <slab_alloc>
Public Types | |
| enum | { object_size = Obj_size , slab_size = Slab_size , objects_per_slab = _A::objects_per_slab , max_free_slabs = Max_free } |
Public Member Functions | |
| void * | alloc () noexcept |
| Allocate an object. | |
| void | free (void *p) noexcept |
| Free the given object (p). | |
| unsigned | total_objects () const noexcept |
| Get the total number of objects managed by the slab allocator. | |
| unsigned | free_objects () const noexcept |
| Get the number of free objects in the slab allocator. | |
Merged slab allocator (allocators for objects of the same size are merged together).
| Obj_size | The size of an object managed by the slab allocator. |
| Slab_size | The size of a slab. |
| Max_free | The maximum number of free slabs. |
| Alloc | The allocator for the slabs. |
This slab allocator class is useful for merging slab allocators with the same parameters (equal Obj_size, Slab_size, Max_free, and Alloc parameters) together and share the overhead for the slab caches among all equal-sized objects.
Definition at line 388 of file slab_alloc.
| anonymous enum |
| Enumerator | |
|---|---|
| object_size | Size of an object. |
| slab_size | Size of a slab. |
| objects_per_slab | Number of objects per slab. |
| max_free_slabs | Maximum number of free slabs. |
Definition at line 395 of file slab_alloc.
|
inlinenoexcept |
Allocate an object.
Definition at line 412 of file slab_alloc.
|
inlinenoexcept |
Free the given object (p).
| p | The pointer to the object to free. |
Definition at line 420 of file slab_alloc.
|
inlinenoexcept |
Get the number of free objects in the slab allocator.
Definition at line 440 of file slab_alloc.
|
inlinenoexcept |
Get the total number of objects managed by the slab allocator.
Definition at line 430 of file slab_alloc.