mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibJS: Round cell sizes up to a multiple of 16 bytes
This increases HeapBlock utilization significantly (and reduces overall memory usage.)
This commit is contained in:
parent
2106dafd62
commit
6c3afca686
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,8 @@ Cell* Heap::allocate_cell(size_t size)
|
|||
return cell;
|
||||
}
|
||||
|
||||
auto block = HeapBlock::create_with_cell_size(*this, size);
|
||||
size_t cell_size = round_up_to_power_of_two(size, 16);
|
||||
auto block = HeapBlock::create_with_cell_size(*this, cell_size);
|
||||
auto* cell = block->allocate();
|
||||
m_blocks.append(move(block));
|
||||
return cell;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue