Function readStringFromMemory

Reads a null-terminated UTF-8 string from the WebAssembly memory.

This function only reads the string; it does not free the pointer. The caller is responsible for managing the memory of the C string if it was dynamically allocated.

  • Parameters

    • ptr: number

      The pointer to the beginning of the string in Wasm memory.

    Returns string

    The resulting JavaScript string.