#include <heap.h>

Data Fields | |
| uint32_t | prev_size |
| uint32_t | size |
| Heap_Block * | next |
| Heap_Block * | prev |
The 'prev_size' field is only valid when HEAP_PREV_USED bit is clear in the 'size' field indicating that previous block is not allocated. If the bit is set, the 'prev_size' field is part of user-accessible space of the previous allocated block and thus shouldn't be accessed by the heap manager code. This trick allows to further decrease overhead in the used blocks to the size of 'size' field (4 bytes).
| uint32_t Heap_Block_struct::prev_size |
size of prev block (if prev block is free)
| uint32_t Heap_Block_struct::size |
size of block in bytes and status of prev block
Referenced by _Heap_Block_size(), and _Heap_Is_prev_used().
pointer to the next free block
Referenced by _Heap_Block_insert_after(), _Heap_Block_remove(), _Heap_Block_replace(), and _Heap_First().
pointer to the previous free block
Referenced by _Heap_Block_insert_after(), _Heap_Block_remove(), _Heap_Block_replace(), and _Heap_Last().
1.5.6