1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:47:45 +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); AK_MAKE_NONCOPYABLE(HeapBlockBase);
public: public:
static constexpr auto block_size = 16 * KiB; static constexpr auto block_size = 4 * KiB;
static HeapBlockBase* from_cell(Cell const* cell) static HeapBlockBase* from_cell(Cell const* cell)
{ {
return reinterpret_cast<HeapBlockBase*>(bit_cast<FlatPtr>(cell) & ~(HeapBlockBase::block_size - 1)); return reinterpret_cast<HeapBlockBase*>(bit_cast<FlatPtr>(cell) & ~(HeapBlockBase::block_size - 1));