Skip to content

Commit 5a4704c

Browse files
committed
Export memory only when EXPORT_ALL is defined
1 parent d437abf commit 5a4704c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The script also produces an optimized module using `wasm-opt -O3` from the *bina
3737
Build options
3838
-------------
3939

40-
- `EXPORT_ALL` exports functions other than `cmem_init` and `cmem_end`, including memory and list management functions.
40+
- `EXPORT_ALL` exports the memory and functions other than `cmem_init` and `cmem_end`, including memory and list management functions.
4141
- `PREFIX_LIBC` prepends `cmem_` to libc function names.
4242
- `FIRST_FIT` employs a first-fit instead of a best-fit strategy for allocation.
4343
- `BULK_MEMORY` enables use of bulk memory instructions, decreasing embedder compatibility.

cmem.wat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@
4646

4747
(module
4848

49-
(memory (export "memory") 1)
49+
(memory
50+
#ifdef EXPORT_ALL
51+
(export "memory")
52+
#endif
53+
1)
54+
5055
(global $cmem_begin (mut i32) (i32.const 0))
5156
(global $cmem_last (mut i32) (i32.const 0))
5257

0 commit comments

Comments
 (0)