MCPcopy Create free account
hub / github.com/brimdata/super / strPtr

Method strPtr

book/super-example/wasm_exec.js:509–518  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

507 let offset = 4096;
508
509 const strPtr = (str) => {
510 const ptr = offset;
511 const bytes = encoder.encode(str + "\0");
512 new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
513 offset += bytes.length;
514 if (offset % 8 !== 0) {
515 offset += 8 - (offset % 8);
516 }
517 return ptr;
518 };
519
520 const argc = this.argv.length;
521

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected