michael@0: load(libdir + "parallelarray-helpers.js"); michael@0: michael@0: function testMap() { michael@0: michael@0: // Note: This is the same kernel function as `alloc-many-objs`, but michael@0: // with a larger bound. This often fails par. exec. because it michael@0: // triggers GC at inconvenient times. But let's just test that it michael@0: // doesn't crash or something! michael@0: michael@0: var ints = range(0, 100000); michael@0: michael@0: // The disqual occurs because each time we try to run we wind up michael@0: // bailing due to running out of memory or requesting a GC. michael@0: assertParallelExecWillBail(function (m) { michael@0: ints.mapPar(kernel, m); michael@0: }); michael@0: michael@0: function kernel(v) { michael@0: var x = []; michael@0: michael@0: if (inParallelSection()) { michael@0: // don't bother to stress test the non-parallel paths! michael@0: for (var i = 0; i < 50; i++) { michael@0: x[i] = []; michael@0: for (var j = 0; j < 1024; j++) { michael@0: x[i][j] = j; michael@0: } michael@0: } michael@0: } michael@0: michael@0: return x; michael@0: } michael@0: } michael@0: michael@0: if (getBuildConfiguration().parallelJS) michael@0: testMap(); michael@0: