Skip to content

Commit 5d4390d

Browse files
authored
examples : add HEAPU8 to all of the exported runtime methods (#3134)
This commit adds HEAPU8 to the list of exported methods. The motivation for this commit is that currently this is causing an error on Window systems where HEAPU8 in undefined, which results in the following error message in the web console: main.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'buffer') at __emval_get_property (main.js:1:1363125) at 003a453a:0xc4a47 at 003a453a:0xc51cd at Object.full_default (eval at craftInvokerFunction (main.js:1:1347011), <anonymous>:9:10) at whisper.cpp/:647:42 danbev originally fixed this for whisper.wasm, stream.wasm, and command.stream, but the issue still exists on the other examples which I patch in this code. Resolves: #3059
1 parent 9791647 commit 5d4390d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/bench.wasm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \
3535
-s INITIAL_MEMORY=2000MB \
3636
-s TOTAL_MEMORY=2000MB \
3737
-s FORCE_FILESYSTEM=1 \
38-
-s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap']\" \
38+
-s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap', 'HEAPU8']\" \
3939
${EXTRA_FLAGS} \
4040
")
4141

examples/wchess/wchess.wasm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \
3232
-s INITIAL_MEMORY=1024MB \
3333
-s TOTAL_MEMORY=1024MB \
3434
-s FORCE_FILESYSTEM=1 \
35-
-s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap']\" \
35+
-s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap', 'HEAPU8']]\" \
3636
${EXTRA_FLAGS} \
3737
")
3838

0 commit comments

Comments
 (0)