|
join 1.0
lightweight network framework library
|
free-list pool operating over a pre-existing memory region. More...
#include <allocator.hpp>

Public Types | |
| using | Chunk = BasicChunk<Size> |
| using | Segment = BasicSegment<Size> |
Public Member Functions | |
| BasicPool (void *ptr) noexcept | |
| initialize the pool over an existing memory region. | |
| BasicPool (const BasicPool &other)=delete | |
| copy constructor. | |
| BasicPool & | operator= (const BasicPool &other)=delete |
| copy assignment operator. | |
| BasicPool (BasicPool &&other) noexcept | |
| move constructor. | |
| BasicPool & | operator= (BasicPool &&other) noexcept |
| move assignment operator. | |
| ~BasicPool ()=default | |
| destroy instance. | |
| void * | pop () noexcept |
| pop a chunk from the pool. | |
| void | push (void *p) noexcept |
| push a chunk back to the pool. | |
| bool | owns (void *p) const noexcept |
| check if the pointer belongs to this pool. | |
Public Attributes | |
| Segment * | _segment = nullptr |
| pointer into the mapped region. | |
Static Public Attributes | |
| static constexpr size_t | _count = Count |
| total number of chunks per pool. | |
| static constexpr size_t | _size = Size |
| size of each chunk in bytes. | |
| static constexpr size_t | _stride = sizeof (Chunk) |
| size in bytes between two consecutive chunks. | |
| static constexpr size_t | _total = sizeof (Segment) + _stride * _count |
| total bytes required in the mapped region for this pool. | |
free-list pool operating over a pre-existing memory region.
| using join::BasicPool< Count, Size >::Chunk = BasicChunk<Size> |
| using join::BasicPool< Count, Size >::Segment = BasicSegment<Size> |
|
inlineexplicitnoexcept |
initialize the pool over an existing memory region.
| ptr | pointer to the start of the region. |
|
delete |
copy constructor.
| other | other object to copy. |
|
inlinenoexcept |
move constructor.
| other | other object to move. |
|
default |
destroy instance.
|
inlinenoexcept |
move assignment operator.
| other | other object to move. |
|
delete |
copy assignment operator.
| other | other object to copy. |
|
inlinenoexcept |
check if the pointer belongs to this pool.
| p | pointer to check. |
|
inlinenoexcept |
pop a chunk from the pool.
|
inlinenoexcept |
push a chunk back to the pool.
| p | pointer to the chunk to return. |
|
staticconstexpr |
total number of chunks per pool.
| Segment* join::BasicPool< Count, Size >::_segment = nullptr |
pointer into the mapped region.
|
staticconstexpr |
size of each chunk in bytes.
|
staticconstexpr |
size in bytes between two consecutive chunks.
|
staticconstexpr |
total bytes required in the mapped region for this pool.