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 Member Functions | |
Type * | alloc () noexcept |
Allocate an object of type Type . | |
Public Member Functions inherited from cxx::Base_slab_static< Obj_size, Slab_size, Max_free, Alloc > | |
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. | |
Additional Inherited Members | |
Public Types inherited from cxx::Base_slab_static< Obj_size, Slab_size, Max_free, Alloc > | |
enum | { object_size = Obj_size , slab_size = Slab_size , objects_per_slab = _A::objects_per_slab , max_free_slabs = Max_free } |
Merged slab allocator (allocators for objects of the same size are merged together).
Type | The type of the objects to manage. |
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 sizeof(Type)
, Slab_size
, Max_free
, and Alloc
parameters) together and share the overhead for the slab caches among all equal-sized objects.
Definition at line 476 of file slab_alloc.
|
inlinenoexcept |
Allocate an object of type Type
.
Definition at line 489 of file slab_alloc.
References cxx::Slab_static< Type, Slab_size, Max_free, Alloc >::alloc().
Referenced by cxx::Slab_static< Type, Slab_size, Max_free, Alloc >::alloc().