mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
base: support exceptions during _new_slab_block
With the introduction of the 'Out_of_caps' exception type, the slab needs to consider exceptions during the call of '_new_slab_block' by reverting the 'nested' state.
This commit is contained in:
parent
c79155fd7b
commit
67481fdfc3
@ -339,17 +339,25 @@ bool Slab::alloc(size_t size, void **out_addr)
|
||||
|
||||
/* allocate new block for slab */
|
||||
_nested = true;
|
||||
Block * const sb = _new_slab_block();
|
||||
_nested = false;
|
||||
|
||||
if (!sb) return false;
|
||||
try {
|
||||
Block * const sb = _new_slab_block();
|
||||
|
||||
/*
|
||||
* The new block has the maximum number of available slots and
|
||||
* so we can insert it at the beginning of the sorted block
|
||||
* list.
|
||||
*/
|
||||
_insert_sb(sb);
|
||||
_nested = false;
|
||||
|
||||
if (!sb) return false;
|
||||
|
||||
/*
|
||||
* The new block has the maximum number of available slots and
|
||||
* so we can insert it at the beginning of the sorted block
|
||||
* list.
|
||||
*/
|
||||
_insert_sb(sb);
|
||||
}
|
||||
catch (...) {
|
||||
_nested = false;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/* skip completely occupied slab blocks, detect cycles */
|
||||
|
Loading…
x
Reference in New Issue
Block a user