L4Re Operating System Framework
Interface and Usage Documentation
|
Slab allocator for object of type Type
.
More...
#include <slab_alloc>
Public Member Functions | |
Type * | alloc () noexcept |
Allocate an object of type Type . | |
void | free (Type *o) noexcept |
Free the object addressed by o . | |
Public Member Functions inherited from cxx::Base_slab< Obj_size, Slab_size, Max_free, Alloc > | |
void * | alloc () noexcept |
Allocate a new object. | |
void | free (void *_o) noexcept |
Free the given object (_o ). | |
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 objects which can be allocated before a new empty slab needs to be added to the slab allocator. | |
Additional Inherited Members | |
Public Types inherited from cxx::Base_slab< Obj_size, Slab_size, Max_free, Alloc > | |
enum | { object_size = Obj_size , slab_size = Slab_size , objects_per_slab = (Slab_size - sizeof(Slab_head)) / object_size , max_free_slabs = Max_free } |
typedef Alloc< Slab_i > | Slab_alloc |
Type of the backend allocator. | |
Slab allocator for object of type Type
.
Type | The type of the objects to manage. |
Slab_size | Size of a slab. |
Max_free | The maximum number of free slabs. |
Alloc | The allocator for the slabs. |
Definition at line 346 of file slab_alloc.
|
inlinenoexcept |
Allocate an object of type Type
.
Definition at line 366 of file slab_alloc.
|
inlinenoexcept |
Free the object addressed by o
.
o | The pointer to the object to free. |
Definition at line 377 of file slab_alloc.
References cxx::Slab< Type, Slab_size, Max_free, Alloc >::free().
Referenced by cxx::Slab< Type, Slab_size, Max_free, Alloc >::free().