|
| | SmallBlockPage (void *ptr, uint8_t sizeType) |
| | Constructs a page for the given size class.
|
| |
|
GAIA_NODISCARD uint32_t | block_stride () const |
| | Returns the stride of one block in this page.
|
| |
|
void | write_block_idx (uint32_t blockIdx, uint32_t value) |
| |
|
GAIA_NODISCARD uint8_t | read_block_idx (uint32_t blockIdx) const |
| |
| GAIA_NODISCARD void * | alloc_block () |
| | Allocates one block from this page.
|
| |
| void | free_block (void *pBlock) |
| | Frees one block back to this page.
|
| |
|
GAIA_NODISCARD uint32_t | used_blocks_cnt () const |
| | Returns the number of live blocks.
|
| |
|
GAIA_NODISCARD bool | full () const |
| | Returns true when the page is full.
|
| |
|
GAIA_NODISCARD bool | empty () const |
| | Returns true when the page is empty.
|
| |
|
void | verify () const |
| | Verifies internal page invariants.
|
| |
|
fwd_llist_link< SmallBlockPage > & | get_fwd_llist_link () |
| |
|
const fwd_llist_link< SmallBlockPage > & | get_fwd_llist_link () const |
| |
|
|
void * | m_data |
| |
|
BlockArray | m_blocks |
| |
|
uint32_t | m_sizeType: SizeTypeBits |
| |
|
uint32_t | m_blockCnt: NBlocks_Bits |
| |
|
uint32_t | m_usedBlocks: NBlocks_Bits |
| |
|
uint32_t | m_nextFreeBlock: NBlocks_Bits |
| |
|
uint32_t | m_freeBlocks: NBlocks_Bits |
| |
|
fwd_llist_link< SmallBlockPage > | fwd_link_GAIA |
| |
|
|
static constexpr uint16_t | NBlocks = 64 |
| |
|
static constexpr uint16_t | NBlocks_Bits = (uint16_t)core::count_bits(NBlocks) |
| |
|
static constexpr uint16_t | SizeTypeBits = (uint16_t)core::count_bits(SmallBlockSizeTypeCount - 1) |
| |
|
static constexpr uint32_t | InvalidBlockId = NBlocks + 1 |
| |
|
static constexpr uint32_t | BlockArrayBytes = ((uint32_t)NBlocks_Bits * (uint32_t)NBlocks + 7) / 8 |
| |
◆ SmallBlockPage()
| gaia::mem::detail::SmallBlockPage::SmallBlockPage |
( |
void * |
ptr, |
|
|
uint8_t |
sizeType |
|
) |
| |
|
inline |
Constructs a page for the given size class.
- Parameters
-
| ptr | Raw page data. |
| sizeType | Size class index. |
◆ alloc_block()
| GAIA_NODISCARD void * gaia::mem::detail::SmallBlockPage::alloc_block |
( |
| ) |
|
|
inline |
Allocates one block from this page.
- Returns
- Pointer to the usable storage.
◆ free_block()
| void gaia::mem::detail::SmallBlockPage::free_block |
( |
void * |
pBlock | ) |
|
|
inline |
Frees one block back to this page.
- Parameters
-
The documentation for this struct was generated from the following file: