MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / gc_alloc

Method gc_alloc

g2all/900/module/mem.js:491–507  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

489 // the backer is an implementation detail. don't use it to mutate the
490 // memory
491 gc_alloc(size) {
492 if (!isInteger(size)) {
493 throw TypeError('size not a integer');
494 }
495 if (size < 0) {
496 throw RangeError('size is negative');
497 }
498
499 const fastLimit = 1000;
500 size = (size + 7 & ~7) >> 3;
501 if (size > fastLimit) {
502 throw RangeError('size is too large');
503 }
504
505 const backer = new Float64Array(size);
506 return [mem.addrof(backer).readp(view_m_vector), backer];
507 }
508
509 fakeobj(addr) {
510 const values = lohi_from_one(addr);

Callers

nothing calls this directly

Calls 2

readpMethod · 0.45
addrofMethod · 0.45

Tested by

no test coverage detected