1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

LibJS: Make it possible to go from a Cell* to its Heap&

This patch makes all HeapBlock allocations aligned to their block size,
enabling us to find the HeapBlock* for a given Cell* by simply masking
bits off of the cell address.

Use this to make a simple Heap& getter for Cell, which lets us avoid
plumbing the Heap& everywhere.
This commit is contained in:
Andreas Kling 2020-03-13 11:01:44 +01:00
parent d9c7009604
commit 6089d6566b
5 changed files with 44 additions and 7 deletions

View file

@ -51,6 +51,8 @@ public:
virtual void visit_children(Visitor&) {}
Heap& heap();
private:
bool m_mark { false };
bool m_live { true };