<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - GC has trouble with pathologically large array allocations"
href="https://bugs.webkit.org/show_bug.cgi?id=144609#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - GC has trouble with pathologically large array allocations"
href="https://bugs.webkit.org/show_bug.cgi?id=144609">bug 144609</a>
from <span class="vcard"><a class="email" href="mailto:fpizlo@apple.com" title="Filip Pizlo <fpizlo@apple.com>"> <span class="fn">Filip Pizlo</span></a>
</span></b>
<pre>Consider the following test, if you tweak the size so that we actually allocate the memory. It causes linear heap growth.
function foo(x) {
return new Array(x);
}
noInline(foo);
function test(size) {
var result = foo(size);
if (result.length != size)
throw "Error: bad result: " + result;
var sawThings = false;
for (var s in result)
sawThings = true;
if (sawThings)
throw "Error: array is in bad state: " + result;
result[0] = "42.5";
if (result[0] != "42.5")
throw "Error: array is in wierd state: " + result;
}
for (var i = 0; i < 100000; ++i) {
test(1000000);
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>