header of the block inside of the heap segment. Occupies 16 bytes.
More...
#include <header.hpp>
|
| | header () |
| | creates the instance of the header.
|
| |
| bool | is_free () const noexcept |
| | checks if the header is free.
|
| |
| bool | is_marked () const noexcept |
| | checks if the header is marked.
|
| |
| void | set_free (bool free) noexcept |
| |
| void | set_marked (bool marked) noexcept |
| |
| void * | data_ptr () noexcept |
| | getter for the address where data begins.
|
| |
| const void * | data_ptr () const noexcept |
| | getter for the address where data begins.
|
| |
|
| static header * | from_data (void *ptr) noexcept |
| | getter for the header of the data.
|
| |
| static const header * | from_data (const void *ptr) noexcept |
| | getter for the header of the data.
|
| |
|
| header * | next |
| | if current block is free => pointer to the next free block; otherwise nullptr.
|
| |
| uint32_t | size |
| | size - the amount of memory the current block occupies.
|
| |
| std::atomic< uint32_t > | flags |
| | flags - 0x000000mf; m - marked (0/1), f - free (0/1).
|
| |
header of the block inside of the heap segment. Occupies 16 bytes.
◆ header()
creates the instance of the header.
sets next to nullptr, size to 0, flags to non-marked, free.
◆ data_ptr() [1/2]
| const void * header::data_ptr |
( |
| ) |
const |
|
noexcept |
getter for the address where data begins.
- Returns
- pointer to const data.
◆ data_ptr() [2/2]
| void * header::data_ptr |
( |
| ) |
|
|
noexcept |
getter for the address where data begins.
- Returns
- pointer to data.
◆ from_data() [1/2]
| const header * header::from_data |
( |
const void * |
ptr | ) |
|
|
staticnoexcept |
getter for the header of the data.
- Parameters
-
| ptr | - const pointer to data. |
- Returns
- const pointer to header.
◆ from_data() [2/2]
| header * header::from_data |
( |
void * |
ptr | ) |
|
|
staticnoexcept |
getter for the header of the data.
- Parameters
-
- Returns
- pointer to header.
◆ is_free()
| bool header::is_free |
( |
| ) |
const |
|
noexcept |
checks if the header is free.
- Returns
- true if header has free flag 1, false otherwise
◆ is_marked()
| bool header::is_marked |
( |
| ) |
const |
|
noexcept |
checks if the header is marked.
- Returns
- true if header has marked flag 1, false otherwise.
◆ set_free()
| void header::set_free |
( |
bool |
free | ) |
|
|
noexcept |
◆ set_marked()
| void header::set_marked |
( |
bool |
marked | ) |
|
|
noexcept |
◆ flags
| std::atomic<uint32_t> header::flags |
flags - 0x000000mf; m - marked (0/1), f - free (0/1).
◆ next
if current block is free => pointer to the next free block; otherwise nullptr.
◆ size
size - the amount of memory the current block occupies.
The documentation for this struct was generated from the following files: