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:
Norman Feske 2017-05-07 23:12:20 +02:00 committed by Christian Helmuth
parent 67481fdfc3
commit f5bdab4518

View File

@ -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
*