mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibJS: Make WeakContainer pruning do less work
Instead of iterating *all* swept cells when pruning weak containers, only iterate the cells actually *in* the container. Also, instead of compiling a list of all swept cells, we can simply check the Cell::state() flag to know if something should be pruned.
This commit is contained in:
parent
19fc225b45
commit
83bd675477
10 changed files with 39 additions and 35 deletions
|
@ -27,7 +27,7 @@ public:
|
|||
HashTable<Cell*> const& values() const { return m_values; };
|
||||
HashTable<Cell*>& values() { return m_values; };
|
||||
|
||||
virtual void remove_swept_cells(Badge<Heap>, Span<Cell*>) override;
|
||||
virtual void remove_dead_cells(Badge<Heap>) override;
|
||||
|
||||
private:
|
||||
#ifdef JS_TRACK_ZOMBIE_CELLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue