1 // We don't need N versions of this simultaneously filling up RAM.
2 //@ if $hostOS == "linux" then skip else runDefault end
6 // Use a full 4GiB so that exhaustion is likely to occur faster. We're not
7 // guaranteed that we'll get that much virtually allocated to the memory so we
8 // can't actually check that exhaustion occurs at a particular number of
10 const maximumPages = 65536;
15 let m = new WebAssembly.Memory({ initial: 64, maximum: maximumPages });
18 print(`${WebAssemblyMemoryMode(m)} ${memories.length}`);
22 print(`Caught: ${e}`);
23 if (e.message !== "Out of memory")
24 throw new Error(`Expected an out of memory error, got ${e} of type ${typeof e}`);