mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS+js: Add a debug option (js -g) to GC after every allocation
This is very useful for discovering collector bugs.
This commit is contained in:
parent
ab404a2f88
commit
cb2e7d1c5f
Notes:
sideshowbarker
2024-07-19 08:16:27 +09:00
Author: https://github.com/awesomekling
Commit: cb2e7d1c5f
3 changed files with 11 additions and 0 deletions
|
@ -49,6 +49,9 @@ Heap::~Heap()
|
|||
|
||||
Cell* Heap::allocate_cell(size_t size)
|
||||
{
|
||||
if (should_collect_on_every_allocation())
|
||||
collect_garbage();
|
||||
|
||||
for (auto& block : m_blocks) {
|
||||
if (size > block->cell_size())
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue