aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasmrt.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasmrt.h b/src/wasmrt.h
index e56d17e..543a029 100644
--- a/src/wasmrt.h
+++ b/src/wasmrt.h
@@ -32,12 +32,20 @@
* overflows on systems with a small stack space. We should consider turning
* this on in case we ever observe this issue. That being said, if we do get
* into a situation where we observe a stack overflow, the game crashed anyway.
+ *
+ * We also set `WASM_RT_USE_MMAP`, even though we don't `mmap` anything: the
+ * generated code only uses it to decide whether it may cache the memory base
+ * pointer and size in local variables instead of reloading them after every
+ * store. This is safe as long as the memory never moves while an instance is
+ * running (there is no `memory.grow` and we refuse `emscripten_resize_heap`).
+ * Caching makes the PICO-8 run noticeably faster.
*/
#define WASM_RT_MEMCHECK_GUARD_PAGES 0
#define WASM_RT_MEMCHECK_BOUNDS_CHECK 1
#define WASM_RT_STACK_DEPTH_COUNT 0
#define WASM_RT_USE_SEGUE 0
+#define WASM_RT_USE_MMAP 1
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define WABT_BIG_ENDIAN 0