mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 15:43:56 +00:00
slab: add option to free empty blocks
explictly by a method Issue #4014
This commit is contained in:
committed by
Norman Feske
parent
19d0142e10
commit
1e84b46c3f
@ -416,6 +416,17 @@ void Slab::_free(void *addr)
|
||||
}
|
||||
|
||||
|
||||
void Slab::free_empty_blocks()
|
||||
{
|
||||
for (size_t blocks = _num_blocks; blocks > 0; blocks--) {
|
||||
if (_curr_sb != _initial_sb && _curr_sb->avail() == _entries_per_block)
|
||||
_free_curr_sb();
|
||||
else
|
||||
_curr_sb = _curr_sb->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void *Slab::any_used_elem()
|
||||
{
|
||||
if (_total_avail == _num_blocks*_entries_per_block)
|
||||
|
Reference in New Issue
Block a user