|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <MemArena.h>

Classes | |
| struct | Item |
| Rebinding type for instances on the free list. More... | |
Public Member Functions | |
| FixedArena (MemArena &arena) | |
| template<typename... Args> | |
| T * | make (Args... args) |
| void | destroy (T *t) |
| void | clear () |
| Drop all items in the free list. | |
| MemArena & | arena () |
| Access the wrapped arena directly. | |
Protected Attributes | |
| Item | _list {nullptr} |
| List of dead instances. | |
| MemArena & | _arena |
| Memory source. | |
Arena of a specific type on top of a MemArena.
| T | Type in the arena. |
A pool of unused / free instances of T is kept for reuse. If none are available then a new instance is allocated from the arena.
Definition at line 528 of file MemArena.h.
|
explicit |
Construct a pool.
| arena | The arena for memory. |
| void swoc::FixedArena< T >::destroy | ( | T * | t | ) |
Destroy an instance.
| t | The instance to destroy. |
The instance is destructed and then put on the free list for re-use.
Create a new instance.
| Args | Constructor argument types. |
| args | Constructor arguments. |
|
protected |
Memory source.
Definition at line 537 of file MemArena.h.
|
protected |
List of dead instances.
Definition at line 536 of file MemArena.h.