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

LibJS: Put zombie cell tracking code behind a compile-time flag

Since this is a debug-only feature, let's not have it impact GC marking
performance when you don't need it.
This commit is contained in:
Andreas Kling 2021-10-02 16:35:55 +02:00
parent f290c59dd8
commit 6a1b82df2b
13 changed files with 76 additions and 8 deletions

View file

@ -62,7 +62,12 @@ public:
bool should_collect_on_every_allocation() const { return m_should_collect_on_every_allocation; }
void set_should_collect_on_every_allocation(bool b) { m_should_collect_on_every_allocation = b; }
void set_zombify_dead_cells(bool b) { m_zombify_dead_cells = b; }
#ifdef JS_TRACK_ZOMBIE_CELLS
void set_zombify_dead_cells(bool b)
{
m_zombify_dead_cells = b;
}
#endif
void did_create_handle(Badge<HandleImpl>, HandleImpl&);
void did_destroy_handle(Badge<HandleImpl>, HandleImpl&);
@ -122,7 +127,10 @@ private:
bool m_should_gc_when_deferral_ends { false };
bool m_collecting_garbage { false };
#ifdef JS_TRACK_ZOMBIE_CELLS
bool m_zombify_dead_cells { false };
#endif
};
}