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

LibJS: Add Cell::must_survive_garbage_collection() mechanism

This allows cells to prevent themselves from being garbage collected,
even when there are no references to them.
This commit is contained in:
Andreas Kling 2022-10-24 12:37:54 +02:00
parent 8ace6b4f1d
commit 51579810bd
3 changed files with 24 additions and 4 deletions

View file

@ -79,6 +79,8 @@ public:
void uproot_cell(Cell* cell);
private:
static bool cell_must_survive_garbage_collection(Cell const&);
Cell* allocate_cell(size_t);
void gather_roots(HashTable<Cell*>&);