Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 load(libdir + "parallelarray-helpers.js");
3 function testMap() {
5 // Note: This is the same kernel function as `alloc-many-objs`, but
6 // with a larger bound. This often fails par. exec. because it
7 // triggers GC at inconvenient times. But let's just test that it
8 // doesn't crash or something!
10 var ints = range(0, 100000);
12 // The disqual occurs because each time we try to run we wind up
13 // bailing due to running out of memory or requesting a GC.
14 assertParallelExecWillBail(function (m) {
15 ints.mapPar(kernel, m);
16 });
18 function kernel(v) {
19 var x = [];
21 if (inParallelSection()) {
22 // don't bother to stress test the non-parallel paths!
23 for (var i = 0; i < 50; i++) {
24 x[i] = [];
25 for (var j = 0; j < 1024; j++) {
26 x[i][j] = j;
27 }
28 }
29 }
31 return x;
32 }
33 }
35 if (getBuildConfiguration().parallelJS)
36 testMap();