From 46a695266ab95e8b5753cc2a45ff9044c4bd381f Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 30 Jun 2026 14:26:12 +1000 Subject: [PATCH] ifcviewer-web: export HEAPU8 for heap-size diagnostics Lets tooling read the wasm heap size (e.g. to verify a large sidecar streams by byte range instead of loading whole, and to watch memory while battle-testing big models over the network). Standard emscripten runtime method, zero size cost. Co-Authored-By: Claude Opus 4.8 --- src/ifcviewer-web/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ifcviewer-web/CMakeLists.txt b/src/ifcviewer-web/CMakeLists.txt index 25defe9874..b79a908a0b 100644 --- a/src/ifcviewer-web/CMakeLists.txt +++ b/src/ifcviewer-web/CMakeLists.txt @@ -105,7 +105,10 @@ target_link_options(IfcViewerWeb PRIVATE # add them to Module. ccall lets shell.html pass a JS string (the ?model # URL) to load_sidecar_from_url_c without manual heap marshalling. "-sEXPORTED_FUNCTIONS=['_main','_raf_tick_c','_load_sidecar_from_blob_c','_load_sidecar_from_url_c','_ifcv_on_range_done','_ifcv_source_ready']" - "-sEXPORTED_RUNTIME_METHODS=['ccall']" + # ccall: shell.html passes the ?model URL string to load_sidecar_from_url_c. + # HEAPU8: lets tooling/tests read the wasm heap size (e.g. to verify a large + # sidecar streams by range instead of loading whole). Standard, zero-cost. + "-sEXPORTED_RUNTIME_METHODS=['ccall','HEAPU8']" # Streaming + chunked geometry want a heap that can grow as buffers # arrive. 256 MB initial, 2 GB ceiling (matches the wasm32 pointer # cap; --shared64 / MEMORY64 would lift this later if we need it).