1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

LibJS: Lower HeapBlock size to 4 KiB

This is to prepare for making per-type allocators, since we'll have a
*lot* more HeapBlocks in that world.
This commit is contained in:
Andreas Kling 2023-11-19 09:43:52 +01:00
parent eca9874e56
commit 84a8ee01e1

View file

@ -33,7 +33,7 @@ class HeapBlockBase {
AK_MAKE_NONCOPYABLE(HeapBlockBase);
public:
static constexpr auto block_size = 16 * KiB;
static constexpr auto block_size = 4 * KiB;
static HeapBlockBase* from_cell(Cell const* cell)
{
return reinterpret_cast<HeapBlockBase*>(bit_cast<FlatPtr>(cell) & ~(HeapBlockBase::block_size - 1));