ssm
0.0.2
Runtime Library for the Sparse Synchronous Model
|
(The beginning of) a block of memory. More...
Data Fields | |
union block * | free_list_next |
Pointer to the next block. More... | |
uint8_t | block_buf [1] |
Variable-size buffer of the block. More... | |
(The beginning of) a block of memory.
The size of each block varies depending on which memory pool it resides in. When a block is being used (allocated), block_buf effectively gives a pointer to the beginning that block that can be indexed into.
When a block is not being used, it is maintained in a free list. If it is not at the head of the free list, then it is pointed to by the free_list_next field of some other block_t, while its own free_list_next points to the next block in the free list. To avoid initializing the free_list_next fields of "fresh" blocks, when free_list_next is UNINITIALIZED_FREE_BLOCK, the next free block contiguously follows the current block in memory. The last free block points to END_OF_FREELIST.