mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
committed by
Christian Helmuth
parent
8840ca96a9
commit
8950de5a89
@@ -146,8 +146,14 @@ void Allocator_avl_base::_destroy_block(Block *b)
|
||||
void Allocator_avl_base::_cut_from_block(Block *b, addr_t addr, size_t size,
|
||||
Block *dst1, Block *dst2)
|
||||
{
|
||||
size_t padding = addr > b->addr() ? addr - b->addr() : 0;
|
||||
size_t remaining = b->size() > (size + padding) ? b->size() - size - padding : 0;
|
||||
size_t const padding = addr > b->addr() ? addr - b->addr() : 0;
|
||||
size_t const b_size = b->size() > padding ? b->size() - padding : 0;
|
||||
size_t remaining = b_size > size ? b_size - size : 0;
|
||||
|
||||
/* case that a block contains the whole addressable range */
|
||||
if (!b->addr() && !b->size())
|
||||
remaining = b->size() - size - padding;
|
||||
|
||||
addr_t orig_addr = b->addr();
|
||||
|
||||
_destroy_block(b);
|
||||
|
||||
Reference in New Issue
Block a user