PATH:
usr
/
lib
/
node_modules
/
pm2
/
node_modules
/
@tootallnate
/
quickjs-emscripten
/
dist
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ModuleMemory = void 0; const lifetime_1 = require("./lifetime"); /** * @private */ class ModuleMemory { constructor(module) { this.module = module; } toPointerArray(handleArray) { const typedArray = new Int32Array(handleArray.map((handle) => handle.value)); const numBytes = typedArray.length * typedArray.BYTES_PER_ELEMENT; const ptr = this.module._malloc(numBytes); var heapBytes = new Uint8Array(this.module.HEAPU8.buffer, ptr, numBytes); heapBytes.set(new Uint8Array(typedArray.buffer)); return new lifetime_1.Lifetime(ptr, undefined, (ptr) => this.module._free(ptr)); } newMutablePointerArray(length) { const zeros = new Int32Array(new Array(length).fill(0)); const numBytes = zeros.length * zeros.BYTES_PER_ELEMENT; const ptr = this.module._malloc(numBytes); const typedArray = new Int32Array(this.module.HEAPU8.buffer, ptr, length); typedArray.set(zeros); return new lifetime_1.Lifetime({ typedArray, ptr }, undefined, (value) => this.module._free(value.ptr)); } newHeapCharPointer(string) { const numBytes = this.module.lengthBytesUTF8(string) + 1; const ptr = this.module._malloc(numBytes); this.module.stringToUTF8(string, ptr, numBytes); return new lifetime_1.Lifetime(ptr, undefined, (value) => this.module._free(value)); } consumeHeapCharPointer(ptr) { const str = this.module.UTF8ToString(ptr); this.module._free(ptr); return str; } } exports.ModuleMemory = ModuleMemory; //# sourceMappingURL=memory.js.map
[-] module-test.js
[edit]
[-] context-asyncify.js
[edit]
[-] context-asyncify.d.ts
[edit]
[-] asyncify-helpers.js
[edit]
[-] runtime-asyncify.js.map
[edit]
[-] errors.js
[edit]
[-] context.js.map
[edit]
[-] memory.d.ts
[edit]
[-] types.js
[edit]
[-] runtime.d.ts
[edit]
[-] types-ffi.js
[edit]
[-] vm-interface.js
[edit]
[-] debug.js
[edit]
[-] types-ffi.d.ts
[edit]
[-] runtime-asyncify.js
[edit]
[-] esmHelpers.d.ts
[edit]
[-] module-test.js.map
[edit]
[-] emscripten-types.d.ts
[edit]
[-] debug.js.map
[edit]
[-] module.d.ts
[edit]
[-] runtime.js
[edit]
[-] emscripten-types.js
[edit]
[-] module-asyncify.js.map
[edit]
[-] variants.d.ts
[edit]
[-] errors.js.map
[edit]
[-] module-asyncify.d.ts
[edit]
[-] runtime.js.map
[edit]
[-] index.js.map
[edit]
[-] types.js.map
[edit]
[-] debug.d.ts
[edit]
[-] emscripten-types.js.map
[edit]
[-] module-test.d.ts
[edit]
[-] types-ffi.js.map
[edit]
[-] deferred-promise.js.map
[edit]
[-] types.d.ts
[edit]
[-] errors.d.ts
[edit]
[-] variants.js.map
[edit]
[-] context.d.ts
[edit]
[-] module.js.map
[edit]
[+]
..
[-] lifetime.js.map
[edit]
[-] deferred-promise.js
[edit]
[-] deferred-promise.d.ts
[edit]
[-] lifetime.js
[edit]
[-] runtime-asyncify.d.ts
[edit]
[+]
generated
[-] asyncify-helpers.d.ts
[edit]
[-] memory.js.map
[edit]
[-] index.d.ts
[edit]
[-] context-asyncify.js.map
[edit]
[-] esmHelpers.js
[edit]
[-] vm-interface.d.ts
[edit]
[-] memory.js
[edit]
[-] lifetime.d.ts
[edit]
[-] module-asyncify.js
[edit]
[-] context.js
[edit]
[-] vm-interface.js.map
[edit]
[-] asyncify-helpers.js.map
[edit]
[-] index.js
[edit]
[-] variants.js
[edit]
[-] module.js
[edit]
[-] esmHelpers.js.map
[edit]