blob: 2504b5f5f19cdc45397f6329ffca2a1284d608cf [file] [log] [blame] [edit]
//@skip if $memoryLimited
function test(v) {
return v.byteLength;
}
noInline(test);
let oneGiga = 1024 * 1024 * 1024;
let fourGigs = 4 * oneGiga;
const b = new ArrayBuffer(fourGigs);
const v = new DataView(b);
globalThis.testLoopCount ??= 10000;
for (let i = 0; i < testLoopCount; i++) {
if (test(v) != fourGigs)
throw new Error("bad");
}