#include <arena.h>
An arena is used to retrieve a page of memory.
This class here is merely to define the interface needed to implement a MemArena.
◆ freeSegment()
| virtual bool cookmem::MemArena::freeSegment |
( |
void * | ptr, |
|
|
std::size_t | size ) |
|
pure virtual |
Free an arena segment.
- Parameters
-
| ptr | the pointer to be freed. |
| size | the size of the pointer. |
- Returns
- true if there is an error. false is okay.
◆ getSegment()
| virtual void * cookmem::MemArena::getSegment |
( |
std::size_t & | size | ) |
|
|
pure virtual |
Allocate an arena segment.
- Parameters
-
| [in,out] | size | the size of the page. This value is updated upon successful request to indicate the actual size obtained. |
- Returns
- the allocated pointer. nullptr is allocation failed.
◆ releaseAll()
| virtual void cookmem::MemArena::releaseAll |
( |
| ) |
|
|
pure virtual |
Release all segments held by this arena. Segments that a memory pool is still using are not affected. An arena that keeps no segments does nothing.
The documentation for this class was generated from the following file: