HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/nodejs/webassemblyjs/esm/interpreter/kernel/memory.js
export var NULL = 0x0; // Allocates memory addresses within the store
// https://webassembly.github.io/spec/core/exec/modules.html#alloc

export function createAllocator() {
  // https://webassembly.github.io/spec/core/exec/runtime.html#store
  var store = [];
  var offset = 0;

  function malloc(size) {
    offset += size;
    return {
      index: offset,
      size: size
    };
  }

  function get(p) {
    return store[p.index];
  }

  function set(p, value) {
    store[p.index] = value;
  }

  function free(p) {
    store[p.index] = NULL;
  }

  return {
    malloc: malloc,
    free: free,
    get: get,
    set: set
  };
}