(bytes)
| 116 | } |
| 117 | |
| 118 | const writeBytes = (bytes) => { |
| 119 | const ptr = exports.wasm_alloc(Math.max(1, bytes.length)); |
| 120 | new Uint8Array(exports.memory.buffer, ptr, bytes.length).set(bytes); |
| 121 | return ptr; |
| 122 | }; |
| 123 | |
| 124 | /* Register a main-thread module at `mt:<name>`: push a stub per export (the real call defers to the page) and tell the compiler its export names. */ |
| 125 | const registerHost = (name, exportNames) => { |