Subastra
|
An object that implements malloc-like behaviour without specifying the exact internal object being managed. More...
#include <freelist.h>
Static Public Member Functions | |
static void | freelist_ledger_init (freelist_ledger_t *ledger, allocator_t allocator, u32 capacity) |
static freelist_ledger_ptr_t | freelist_ledger_reserve (freelist_ledger_t *ledger, u32 size) |
Reserves the next block from the ledger. Returns FREELIST_LEDGER_INVALID_BLOCK if the requested block does not fit. | |
static void | freelist_ledger_release (freelist_ledger_t *ledger, freelist_ledger_ptr_t at) |
Returns the block back into the pool. | |
static void | freelist_ledger_cleanup (freelist_ledger_t *ledger) |
Data Fields | |
list_t | _blocks |
The blocks that were reserved. Contrary to the name, this list stores the busy blocks, not the free ones. | |
u32 | capacity |
The maximum amount of slots managed by the ledger. Errors out if reached. | |
An object that implements malloc-like behaviour without specifying the exact internal object being managed.
Functionallity equivalent to a slab allocator without any actual memory control.
|
static |
|
static |
|
static |
Returns the block back into the pool.
|
static |
Reserves the next block from the ledger. Returns FREELIST_LEDGER_INVALID_BLOCK if the requested block does not fit.
list_t _blocks |
The blocks that were reserved. Contrary to the name, this list stores the busy blocks, not the free ones.
u32 capacity |
The maximum amount of slots managed by the ledger. Errors out if reached.