Free List structure Free lists are stored as circular doubly-linked lists. Every possible allocation size has an associated free list that is threaded through all currently free blocks of that size. That means MIN_ALLOC must be at least "sizeof(List)".
More...
|
void | clear () |
| Clear the list Because these are circular lists, an "empty" list is an entry where both links point to itself. This makes insertion and removal simpler because they don't need any branches.
|
|
void | push (List *entry) |
| Append the provided entry to the end of the list. This assumes the entry isn't in a list already because it overwrites the linked list pointers. More...
|
|
List * | remove () |
| Remove the provided entry from whichever list it's currently in. This assumes that the entry is in a list. You don't need to provide the list because the lists are circular, so the list's pointers will automatically be updated if the first or last entries are removed. More...
|
|
List * | pop () |
| Remove and return the first entry in the list. More...
|
|
|
List * | prev |
| Pointer to previous item (or this if first)
|
|
List * | next |
| Pointer to next item (or this if last)
|
|
template<size_t MIN_ALLOC_LOG2, size_t MAX_ALLOC_LOG2, size_t BLOCK_SIZE, void *(*)(void *, size_t) RESERVE>
struct Allocator::Buddy< MIN_ALLOC_LOG2, MAX_ALLOC_LOG2, BLOCK_SIZE, RESERVE >::List
Free List structure Free lists are stored as circular doubly-linked lists. Every possible allocation size has an associated free list that is threaded through all currently free blocks of that size. That means MIN_ALLOC must be at least "sizeof(List)".
◆ pop()
template<size_t MIN_ALLOC_LOG2, size_t MAX_ALLOC_LOG2, size_t BLOCK_SIZE, void *(*)(void *, size_t) RESERVE>
Remove and return the first entry in the list.
- Returns
- the first entry or nullptr if the list is empty.
◆ push()
template<size_t MIN_ALLOC_LOG2, size_t MAX_ALLOC_LOG2, size_t BLOCK_SIZE, void *(*)(void *, size_t) RESERVE>
void Allocator::Buddy< MIN_ALLOC_LOG2, MAX_ALLOC_LOG2, BLOCK_SIZE, RESERVE >::List::push |
( |
List * |
entry | ) |
|
|
inline |
Append the provided entry to the end of the list. This assumes the entry isn't in a list already because it overwrites the linked list pointers.
- Parameters
-
◆ remove()
template<size_t MIN_ALLOC_LOG2, size_t MAX_ALLOC_LOG2, size_t BLOCK_SIZE, void *(*)(void *, size_t) RESERVE>
Remove the provided entry from whichever list it's currently in. This assumes that the entry is in a list. You don't need to provide the list because the lists are circular, so the list's pointers will automatically be updated if the first or last entries are removed.
- Returns
- pointer to the element
The documentation for this struct was generated from the following file: