1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibJS: Use a HashTable to identify potential cell pointers in GC scan

Previously we would iterate over all the live HeapBlocks in order to
learn if an arbitrary pointer-sized value was a pointer into a live
HeapBlock. This was quite time-consuming.

Instead of that, just put all the live HeapBlock*'s in a HashTable
and identify pointers by doing a bit-masked lookup into the table.
This commit is contained in:
Andreas Kling 2020-11-10 20:24:08 +01:00
parent 50aa726db7
commit 1745e503aa
2 changed files with 15 additions and 24 deletions

View file

@ -100,8 +100,6 @@ private:
void mark_live_cells(const HashTable<Cell*>& live_cells);
void sweep_dead_cells(bool print_report, const Core::ElapsedTimer&);
Cell* cell_from_possible_pointer(FlatPtr);
Allocator& allocator_for_size(size_t);
template<typename Callback>