mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
base: add Slab::avail_entries accessor
This accessor is useful to eagerly expand the slab with new slab blocks, side stepping the slab's built-in policy for the allocation of new slab blocks. This is particularly important when using the slab for allocating the cap space meta-data for the base-hw kernel. To guarantee that the slab gets never exhausted in the kernel, it is expanded before entering the kernel.
This commit is contained in:
parent
67481fdfc3
commit
f5bdab4518
@ -109,6 +109,11 @@ class Genode::Slab : public Allocator
|
||||
*/
|
||||
static size_t entry_costs(size_t slab_size, size_t block_size);
|
||||
|
||||
/**
|
||||
* Return number of unused slab entries
|
||||
*/
|
||||
size_t avail_entries() const { return _total_avail; }
|
||||
|
||||
/**
|
||||
* Add new slab block as backing store
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user