[JSC] Add tests ensuring that extraMemorySize is monotonically increasing until full-collection happens
https://bugs.webkit.org/show_bug.cgi?id=241832
rdar://95384643

Reviewed by Mark Lam.

This patch adds tests ensuring that extraMemorySize is monotonically increasing until full-collection happens.
If this assumption is broken, GC scheduling can be confused. And we crash with existing assertions.

* JSTests/stress/array-buffer-transfer-should-not-reduce-extra-memory-size.js: Added.

Canonical link: https://commits.webkit.org/251715@main


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@295710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JSTests/stress/array-buffer-transfer-should-not-reduce-extra-memory-size.js b/JSTests/stress/array-buffer-transfer-should-not-reduce-extra-memory-size.js
new file mode 100644
index 0000000..69072c5
--- /dev/null
+++ b/JSTests/stress/array-buffer-transfer-should-not-reduce-extra-memory-size.js
@@ -0,0 +1,2 @@
+for (let i = 0; i < 100; i++)
+    transferArrayBuffer(new Uint8Array(2 ** 21).buffer);