js/src/jit-test/tests/basic/testStringBufferMallocAccounting.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/basic/testStringBufferMallocAccounting.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +// first build a big honkin' string
     1.5 +str = "a";
     1.6 +for (var i = 0; i < 20; ++i)
     1.7 +    str = str + str;
     1.8 +str.indexOf('a');
     1.9 +
    1.10 +var f;
    1.11 +f = makeFinalizeObserver();
    1.12 +assertEq(finalizeCount(), 0);
    1.13 +
    1.14 +// Create another observer to make sure that we overwrite all conservative
    1.15 +// roots for the previous one and can observer the GC.
    1.16 +f = makeFinalizeObserver();
    1.17 +
    1.18 +// if the assert fails, add more iterations
    1.19 +for (var i = 0; i < 80; ++i)
    1.20 +    str.replace(/(a)/, '$1');
    1.21 +//assertEq(finalizeCount(), 1);

mercurial