summaryrefslogtreecommitdiff
path: root/Base/home
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-21 11:45:50 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-21 11:46:47 +0100
commit2106dafd62822ba1af0f3c74a742756c969501f3 (patch)
tree443fd98c8b279edf7620e7b5e8bdfa2cd44a0754 /Base/home
parentbc002f807a122bcd91498f87b970671a2d38bbb8 (diff)
downloadserenity-2106dafd62822ba1af0f3c74a742756c969501f3.zip
LibJS: Delete fully-empty HeapBlocks after garbage collection
We now deallocate GC blocks when they are found to have no live cells inside them.
Diffstat (limited to 'Base/home')
-rw-r--r--Base/home/anon/js/gc-strings.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/Base/home/anon/js/gc-strings.js b/Base/home/anon/js/gc-strings.js
new file mode 100644
index 0000000000..39d5400817
--- /dev/null
+++ b/Base/home/anon/js/gc-strings.js
@@ -0,0 +1,8 @@
+function foo() {
+ var a = [];
+ for (var i = 0; i < 4000; ++i) {
+ a.push("string" + i);
+ }
+}
+
+foo();