Represents a contiguous region of memory in the pool. More...
#include <mempool.h>
Public Member Functions | |
| bool | operator< (const Block &other) const |
| Orders blocks by address for sorted storage. | |
| uintptr_t | alignedAddress (size_t align) const |
| Returns the address aligned to the given alignment. | |
| uintptr_t | alignedAddress () const |
| Returns the address aligned to this block's alignment. | |
| size_t | padding (size_t align) const |
| Returns padding bytes needed to reach the given alignment. | |
| size_t | padding () const |
| Returns padding bytes needed for this block's alignment. | |
| bool | follows (const Block &block) const |
| Returns true if this block immediately follows another. | |
Public Attributes | |
| bool | allocated = false |
| true if this block is allocated. | |
| intptr_t | address = 0 |
| Starting address of the block. | |
| size_t | size = 0 |
| Size in bytes. | |
| size_t | alignment = 1 |
| Alignment requirement. | |
Represents a contiguous region of memory in the pool.
|
inline |
Returns the address aligned to this block's alignment.
Returns the address aligned to the given alignment.
| align | The alignment boundary (must be a power of two). |
Returns true if this block immediately follows another.
| block | The preceding block to check adjacency against. |
|
inline |
Returns padding bytes needed for this block's alignment.
Returns padding bytes needed to reach the given alignment.
| align | The alignment boundary. |