mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00
LibJS: Make sure we mark everything reachable from the scope stack
This ensures that local variables survive GC.
This commit is contained in:
parent
26165cd92a
commit
363c40e3f3
3 changed files with 17 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/HashTable.h>
|
||||
#include <LibJS/Heap.h>
|
||||
#include <LibJS/HeapBlock.h>
|
||||
|
@ -72,7 +73,7 @@ void Heap::collect_garbage()
|
|||
|
||||
void Heap::collect_roots(HashTable<Cell*>& roots)
|
||||
{
|
||||
roots.set(&m_interpreter.global_object());
|
||||
m_interpreter.collect_roots({}, roots);
|
||||
|
||||
#ifdef HEAP_DEBUG
|
||||
dbg() << "collect_roots:";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue