Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WASMExportedRuntime

Hierarchy

Index

Properties

HEAPU8

HEAPU8: Uint8Array

Emscripten HEAP, use this for raw memory access.

Methods

UTF8ToString

  • UTF8ToString(ptr: number, maxBytesToRead?: number): string
  • Given a pointer ptr to a null-terminated UTF8-encoded string in the Emscripten HEAP, returns a copy of that string as a JavaScript String object.

    Parameters

    • ptr: number

      A pointer to a null-terminated UTF8-encoded string in the Emscripten HEAP.

    • Optional maxBytesToRead: number

      An optional length that specifies the maximum number of bytes to read. Omit to read until the null-terminator.

    Returns string

_free

  • _free(ptr: number): void
  • Free an allocated block of memory.

    Parameters

    • ptr: number

      Pointer to a memory block previously allocated with malloc.

    Returns void

_malloc

  • _malloc(size: number): number
  • Allocate a block of {@link size} bytes of memory in Emscripten HEAP

    Parameters

    • size: number

      Size of the memory block, in bytes.

    Returns number

    Returns a pointer to the beginning of the block.

getValue

  • Gets a value at a specific memory address at run-time. NOTE: it only does aligned write and read.

    Parameters

    • ptr: number

      A pointer (number) representing the memory address.

    • type: WASM_NUMBER

      An LLVM IR type as a string.

    Returns number

    value at a specific address.

writeArrayToMemory

  • writeArrayToMemory(data: Uint8Array, bufferPointer: number): void
  • Write an uint8 array to the Emscripten HEAP.

    Parameters

    • data: Uint8Array

      Data to be written inside the Emscripten HEAP.

    • bufferPointer: number

      Address pointer

    Returns void

Generated using TypeDoc