ladybird/Userland/Libraries/LibJS/Tests/gc-deeply-nested-object-graph.js
Andreas Kling 7826cb2556 LibJS: Use a work queue instead of the C++ stack for the GC mark phase
This fixes an issue where we'd run out of C++ stack while traversing
large GC heap graphs.
2023-01-10 15:30:07 -05:00

11 lines
207 B
JavaScript

test("garbage collection of a deeply-nested object graph", () => {
let root = {};
let o = root;
for (let i = 0; i < 200_000; ++i) {
o.next = {};
o = o.next;
}
gc();
});