krillplayer-plugin 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +1 -0
  3. package/dist/cli.js +351 -73
  4. package/dist/crypto.js +37 -11
  5. package/dist/engine/engine.c +6 -3
  6. package/kernel/Sources/CQuickJS/include/kernel_qjs.h +8 -1
  7. package/kernel/Sources/CQuickJS/kernel_internal.h +54 -0
  8. package/kernel/Sources/CQuickJS/kernel_qjs.c +17 -29
  9. package/kernel/Sources/CQuickJS/kernel_wasm.c +1155 -0
  10. package/kernel/Sources/CWAMR/include/kernel_wamr.h +151 -0
  11. package/kernel/Sources/CWAMR/include/kernel_wamr_config.h +66 -0
  12. package/kernel/Sources/CWAMR/vendor/LICENSE +219 -0
  13. package/kernel/Sources/CWAMR/vendor/core/config.h +727 -0
  14. package/kernel/Sources/CWAMR/vendor/core/iwasm/aot/aot_runtime.h +899 -0
  15. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/arch/invokeNative_general.c +123 -0
  16. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_application.c +933 -0
  17. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_blocking_op.c +92 -0
  18. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_c_api.c +5391 -0
  19. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_c_api_internal.h +246 -0
  20. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_exec_env.c +336 -0
  21. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_exec_env.h +328 -0
  22. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_loader_common.c +242 -0
  23. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_loader_common.h +62 -0
  24. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_memory.c +1999 -0
  25. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_memory.h +154 -0
  26. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_native.c +1532 -0
  27. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_native.h +117 -0
  28. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_runtime_common.c +8070 -0
  29. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_runtime_common.h +1396 -0
  30. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_shared_memory.c +477 -0
  31. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_shared_memory.h +63 -0
  32. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_suspend_flags.h +52 -0
  33. package/kernel/Sources/CWAMR/vendor/core/iwasm/compilation/aot.h +366 -0
  34. package/kernel/Sources/CWAMR/vendor/core/iwasm/include/lib_export.h +60 -0
  35. package/kernel/Sources/CWAMR/vendor/core/iwasm/include/wasm_c_api.h +910 -0
  36. package/kernel/Sources/CWAMR/vendor/core/iwasm/include/wasm_export.h +2440 -0
  37. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm.h +1492 -0
  38. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_interp.h +122 -0
  39. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_interp_fast.c +7998 -0
  40. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_loader.c +16909 -0
  41. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_loader.h +80 -0
  42. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_opcode.h +1043 -0
  43. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_runtime.c +5174 -0
  44. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_runtime.h +912 -0
  45. package/kernel/Sources/CWAMR/vendor/core/iwasm/libraries/thread-mgr/thread_manager.c +1569 -0
  46. package/kernel/Sources/CWAMR/vendor/core/iwasm/libraries/thread-mgr/thread_manager.h +256 -0
  47. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_alloc.c +1169 -0
  48. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc.c +497 -0
  49. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc.h +350 -0
  50. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc_internal.h +384 -0
  51. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_hmu.c +95 -0
  52. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_kfc.c +547 -0
  53. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/mem_alloc.c +252 -0
  54. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/mem_alloc.h +96 -0
  55. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/memory/mremap.c +12 -0
  56. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_blocking_op.c +70 -0
  57. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_malloc.c +72 -0
  58. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_memmap.c +302 -0
  59. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_sleep.c +20 -0
  60. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_thread.c +784 -0
  61. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_time.c +28 -0
  62. package/kernel/Sources/CWAMR/vendor/core/shared/platform/darwin/platform_init.c +43 -0
  63. package/kernel/Sources/CWAMR/vendor/core/shared/platform/darwin/platform_internal.h +126 -0
  64. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_api_extension.h +1676 -0
  65. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_api_vmcore.h +192 -0
  66. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_common.h +204 -0
  67. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_wasi_types.h +610 -0
  68. package/kernel/Sources/CWAMR/vendor/core/shared/platform/linux/platform_init.c +43 -0
  69. package/kernel/Sources/CWAMR/vendor/core/shared/platform/linux/platform_internal.h +139 -0
  70. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_assert.c +25 -0
  71. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_assert.h +42 -0
  72. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_atomic.h +300 -0
  73. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_bitmap.c +27 -0
  74. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_bitmap.h +114 -0
  75. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_common.c +217 -0
  76. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_common.h +83 -0
  77. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_hashmap.c +339 -0
  78. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_hashmap.h +168 -0
  79. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_leb128.c +77 -0
  80. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_leb128.h +30 -0
  81. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_list.c +111 -0
  82. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_list.h +109 -0
  83. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_log.c +111 -0
  84. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_log.h +94 -0
  85. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_platform.h +38 -0
  86. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_queue.c +256 -0
  87. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_queue.h +80 -0
  88. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_vector.c +279 -0
  89. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_vector.h +126 -0
  90. package/kernel/Sources/CWAMR/vendor/core/shared/utils/gnuc.h +14 -0
  91. package/kernel/Sources/CWAMR/vendor/core/shared/utils/runtime_timer.c +469 -0
  92. package/kernel/Sources/CWAMR/vendor/core/shared/utils/runtime_timer.h +51 -0
  93. package/kernel/Sources/CWAMR/vendor/core/version.h +24 -0
  94. package/kernel/Sources/CWAMR/wamr_bh_assert.c +98 -0
  95. package/kernel/Sources/CWAMR/wamr_bh_bitmap.c +98 -0
  96. package/kernel/Sources/CWAMR/wamr_bh_common.c +98 -0
  97. package/kernel/Sources/CWAMR/wamr_bh_hashmap.c +98 -0
  98. package/kernel/Sources/CWAMR/wamr_bh_leb128.c +98 -0
  99. package/kernel/Sources/CWAMR/wamr_bh_list.c +98 -0
  100. package/kernel/Sources/CWAMR/wamr_bh_log.c +98 -0
  101. package/kernel/Sources/CWAMR/wamr_bh_queue.c +98 -0
  102. package/kernel/Sources/CWAMR/wamr_bh_vector.c +98 -0
  103. package/kernel/Sources/CWAMR/wamr_ems_alloc.c +98 -0
  104. package/kernel/Sources/CWAMR/wamr_ems_gc.c +98 -0
  105. package/kernel/Sources/CWAMR/wamr_ems_hmu.c +98 -0
  106. package/kernel/Sources/CWAMR/wamr_ems_kfc.c +98 -0
  107. package/kernel/Sources/CWAMR/wamr_invokeNative_general.c +98 -0
  108. package/kernel/Sources/CWAMR/wamr_mem_alloc.c +98 -0
  109. package/kernel/Sources/CWAMR/wamr_mremap.c +98 -0
  110. package/kernel/Sources/CWAMR/wamr_platform_init_darwin.c +100 -0
  111. package/kernel/Sources/CWAMR/wamr_platform_init_linux.c +100 -0
  112. package/kernel/Sources/CWAMR/wamr_posix_blocking_op.c +98 -0
  113. package/kernel/Sources/CWAMR/wamr_posix_malloc.c +98 -0
  114. package/kernel/Sources/CWAMR/wamr_posix_memmap.c +98 -0
  115. package/kernel/Sources/CWAMR/wamr_posix_sleep.c +98 -0
  116. package/kernel/Sources/CWAMR/wamr_posix_thread.c +98 -0
  117. package/kernel/Sources/CWAMR/wamr_posix_time.c +98 -0
  118. package/kernel/Sources/CWAMR/wamr_runtime_timer.c +98 -0
  119. package/kernel/Sources/CWAMR/wamr_thread_manager.c +98 -0
  120. package/kernel/Sources/CWAMR/wamr_wasm_application.c +98 -0
  121. package/kernel/Sources/CWAMR/wamr_wasm_blocking_op.c +98 -0
  122. package/kernel/Sources/CWAMR/wamr_wasm_c_api.c +98 -0
  123. package/kernel/Sources/CWAMR/wamr_wasm_exec_env.c +98 -0
  124. package/kernel/Sources/CWAMR/wamr_wasm_interp_fast.c +98 -0
  125. package/kernel/Sources/CWAMR/wamr_wasm_loader.c +98 -0
  126. package/kernel/Sources/CWAMR/wamr_wasm_loader_common.c +98 -0
  127. package/kernel/Sources/CWAMR/wamr_wasm_memory.c +98 -0
  128. package/kernel/Sources/CWAMR/wamr_wasm_native.c +98 -0
  129. package/kernel/Sources/CWAMR/wamr_wasm_runtime.c +98 -0
  130. package/kernel/Sources/CWAMR/wamr_wasm_runtime_common.c +98 -0
  131. package/kernel/Sources/CWAMR/wamr_wasm_shared_memory.c +98 -0
  132. package/kernel/Sources/Kernel/PluginPrelude.js +5 -2
  133. package/kernel/Tests/KernelTests/CasePins.js +50 -0
  134. package/package.json +2 -2
  135. package/skill/krillplayer-plugin/SKILL.md +2 -0
  136. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-content-rejected.json +8 -4
  137. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-login-expired.json +8 -4
  138. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-muted.json +8 -4
  139. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-other.json +8 -4
  140. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-rate-limited.json +8 -4
  141. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-sent.json +8 -4
  142. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-logged-in.json +39 -0
  143. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-selected-backup-line.json +8 -0
  144. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-selected-line-gone.json +8 -0
  145. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live.json +8 -0
  146. package/skill/krillplayer-plugin/assets/samples/live-video-platform/plugin.ts +26 -9
  147. package/skill/krillplayer-plugin/references/cases.md +19 -1
  148. package/skill/krillplayer-plugin/references/contract.d.ts +104 -11
  149. package/skill/krillplayer-plugin/references/crypto-tools.md +104 -0
  150. package/skill/krillplayer-plugin/references/errors-and-fixes.md +5 -1
@@ -0,0 +1,727 @@
1
+ /*
2
+ * Copyright (C) 2019 Intel Corporation. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
+ */
5
+
6
+ #ifndef _CONFIG_H_
7
+ #define _CONFIG_H_
8
+
9
+ /* clang-format off */
10
+ #if !defined(BUILD_TARGET_X86_64) \
11
+ && !defined(BUILD_TARGET_AMD_64) \
12
+ && !defined(BUILD_TARGET_AARCH64) \
13
+ && !defined(BUILD_TARGET_X86_32) \
14
+ && !defined(BUILD_TARGET_ARM) \
15
+ && !defined(BUILD_TARGET_ARM_VFP) \
16
+ && !defined(BUILD_TARGET_THUMB) \
17
+ && !defined(BUILD_TARGET_THUMB_VFP) \
18
+ && !defined(BUILD_TARGET_MIPS) \
19
+ && !defined(BUILD_TARGET_XTENSA) \
20
+ && !defined(BUILD_TARGET_RISCV64_LP64D) \
21
+ && !defined(BUILD_TARGET_RISCV64_LP64) \
22
+ && !defined(BUILD_TARGET_RISCV32_ILP32D) \
23
+ && !defined(BUILD_TARGET_RISCV32_ILP32F) \
24
+ && !defined(BUILD_TARGET_RISCV32_ILP32) \
25
+ && !defined(BUILD_TARGET_ARC)
26
+ /* clang-format on */
27
+ #if defined(__x86_64__) || defined(__x86_64)
28
+ #define BUILD_TARGET_X86_64
29
+ #elif defined(__amd64__) || defined(__amd64)
30
+ #define BUILD_TARGET_AMD_64
31
+ #elif defined(__aarch64__)
32
+ #define BUILD_TARGET_AARCH64
33
+ #elif defined(__i386__) || defined(__i386) || defined(i386)
34
+ #define BUILD_TARGET_X86_32
35
+ #elif defined(__thumb__)
36
+ #define BUILD_TARGET_THUMB
37
+ #define BUILD_TARGET "THUMBV4T"
38
+ #elif defined(__arm__)
39
+ #define BUILD_TARGET_ARM
40
+ #define BUILD_TARGET "ARMV4T"
41
+ #elif defined(__mips__) || defined(__mips) || defined(mips)
42
+ #define BUILD_TARGET_MIPS
43
+ #elif defined(__XTENSA__)
44
+ #define BUILD_TARGET_XTENSA
45
+ #elif defined(__riscv) && (__riscv_xlen == 64)
46
+ #define BUILD_TARGET_RISCV64_LP64D
47
+ #elif defined(__riscv) && (__riscv_xlen == 32) && !defined(__riscv_flen)
48
+ #define BUILD_TARGET_RISCV32_ILP32
49
+ #elif defined(__riscv) && (__riscv_xlen == 32) && (__riscv_flen == 32)
50
+ #define BUILD_TARGET_RISCV32_ILP32F
51
+ #elif defined(__riscv) && (__riscv_xlen == 32) && (__riscv_flen == 64)
52
+ #define BUILD_TARGET_RISCV32_ILP32D
53
+ #elif defined(__arc__)
54
+ #define BUILD_TARGET_ARC
55
+ #else
56
+ #error "Build target isn't set"
57
+ #endif
58
+ #endif
59
+
60
+ #ifndef BH_DEBUG
61
+ #define BH_DEBUG 0
62
+ #endif
63
+
64
+ #define MEM_ALLOCATOR_EMS 0
65
+ #define MEM_ALLOCATOR_TLSF 1
66
+
67
+ /* Default memory allocator */
68
+ #define DEFAULT_MEM_ALLOCATOR MEM_ALLOCATOR_EMS
69
+
70
+ #ifndef WASM_ENABLE_INTERP
71
+ #define WASM_ENABLE_INTERP 0
72
+ #endif
73
+
74
+ #ifndef WASM_ENABLE_AOT
75
+ #define WASM_ENABLE_AOT 0
76
+ #endif
77
+
78
+ #ifndef WASM_ENABLE_DYNAMIC_AOT_DEBUG
79
+ #define WASM_ENABLE_DYNAMIC_AOT_DEBUG 0
80
+ #endif
81
+
82
+ #ifndef WASM_ENABLE_WORD_ALIGN_READ
83
+ #define WASM_ENABLE_WORD_ALIGN_READ 0
84
+ #endif
85
+
86
+ #define AOT_MAGIC_NUMBER 0x746f6100
87
+ #define AOT_CURRENT_VERSION 5
88
+
89
+ #ifndef WASM_ENABLE_JIT
90
+ #define WASM_ENABLE_JIT 0
91
+ #endif
92
+
93
+ #ifndef WASM_ENABLE_LAZY_JIT
94
+ #define WASM_ENABLE_LAZY_JIT 0
95
+ #endif
96
+
97
+ #ifndef WASM_ORC_JIT_BACKEND_THREAD_NUM
98
+ /* The number of backend threads created by runtime */
99
+ #define WASM_ORC_JIT_BACKEND_THREAD_NUM 4
100
+ #endif
101
+
102
+ #if WASM_ORC_JIT_BACKEND_THREAD_NUM < 1
103
+ #error "WASM_ORC_JIT_BACKEND_THREAD_NUM must be greater than 0"
104
+ #endif
105
+
106
+ #ifndef WASM_ORC_JIT_COMPILE_THREAD_NUM
107
+ /* The number of compilation threads created by LLVM JIT */
108
+ #define WASM_ORC_JIT_COMPILE_THREAD_NUM 4
109
+ #endif
110
+
111
+ #if WASM_ORC_JIT_COMPILE_THREAD_NUM < 1
112
+ #error "WASM_ORC_JIT_COMPILE_THREAD_NUM must be greater than 0"
113
+ #endif
114
+
115
+ #if (WASM_ENABLE_AOT == 0) && (WASM_ENABLE_JIT != 0)
116
+ /* LLVM JIT can only be enabled when AOT is enabled */
117
+ #undef WASM_ENABLE_JIT
118
+ #define WASM_ENABLE_JIT 0
119
+
120
+ #undef WASM_ENABLE_LAZY_JIT
121
+ #define WASM_ENABLE_LAZY_JIT 0
122
+ #endif
123
+
124
+ #ifndef WASM_ENABLE_FAST_JIT
125
+ #define WASM_ENABLE_FAST_JIT 0
126
+ #endif
127
+
128
+ #ifndef WASM_ENABLE_FAST_JIT_DUMP
129
+ #define WASM_ENABLE_FAST_JIT_DUMP 0
130
+ #endif
131
+
132
+ #ifndef FAST_JIT_DEFAULT_CODE_CACHE_SIZE
133
+ #define FAST_JIT_DEFAULT_CODE_CACHE_SIZE 10 * 1024 * 1024
134
+ #endif
135
+
136
+ #ifndef WASM_ENABLE_WAMR_COMPILER
137
+ #define WASM_ENABLE_WAMR_COMPILER 0
138
+ #endif
139
+
140
+ #ifndef WASM_ENABLE_LIBC_BUILTIN
141
+ #define WASM_ENABLE_LIBC_BUILTIN 0
142
+ #endif
143
+
144
+ #ifndef WASM_ENABLE_LIBC_WASI
145
+ #define WASM_ENABLE_LIBC_WASI 0
146
+ #endif
147
+
148
+ #ifndef WASM_ENABLE_UVWASI
149
+ #define WASM_ENABLE_UVWASI 0
150
+ #endif
151
+
152
+ #ifndef WASM_ENABLE_WASI_NN
153
+ #define WASM_ENABLE_WASI_NN 0
154
+ #endif
155
+
156
+ #ifndef WASM_ENABLE_WASI_NN_GPU
157
+ #define WASM_ENABLE_WASI_NN_GPU 0
158
+ #endif
159
+
160
+ #ifndef WASM_ENABLE_WASI_NN_EXTERNAL_DELEGATE
161
+ #define WASM_ENABLE_WASI_NN_EXTERNAL_DELEGATE 0
162
+ #endif
163
+
164
+ #ifndef WASM_ENABLE_WASI_EPHEMERAL_NN
165
+ #define WASM_ENABLE_WASI_EPHEMERAL_NN 0
166
+ #endif
167
+
168
+ /* Default disable libc emcc */
169
+ #ifndef WASM_ENABLE_LIBC_EMCC
170
+ #define WASM_ENABLE_LIBC_EMCC 0
171
+ #endif
172
+
173
+ #ifndef WASM_ENABLE_LIB_RATS
174
+ #define WASM_ENABLE_LIB_RATS 0
175
+ #endif
176
+
177
+ #ifndef WASM_ENABLE_LIB_PTHREAD
178
+ #define WASM_ENABLE_LIB_PTHREAD 0
179
+ #endif
180
+
181
+ #ifndef WASM_ENABLE_LIB_PTHREAD_SEMAPHORE
182
+ #define WASM_ENABLE_LIB_PTHREAD_SEMAPHORE 0
183
+ #endif
184
+
185
+ #ifndef WASM_ENABLE_LIB_WASI_THREADS
186
+ #define WASM_ENABLE_LIB_WASI_THREADS 0
187
+ #endif
188
+
189
+ #ifndef WASM_ENABLE_HEAP_AUX_STACK_ALLOCATION
190
+ #define WASM_ENABLE_HEAP_AUX_STACK_ALLOCATION WASM_ENABLE_LIB_WASI_THREADS
191
+ #elif WASM_ENABLE_HEAP_AUX_STACK_ALLOCATION == 0 \
192
+ && WASM_ENABLE_LIB_WASI_THREADS == 1
193
+ #error "Heap aux stack allocation must be enabled for WASI threads"
194
+ #endif
195
+
196
+ #ifndef WASM_ENABLE_COPY_CALL_STACK
197
+ #define WASM_ENABLE_COPY_CALL_STACK 0
198
+ #endif
199
+
200
+ #ifndef WASM_ENABLE_BASE_LIB
201
+ #define WASM_ENABLE_BASE_LIB 0
202
+ #endif
203
+
204
+ #ifndef WASM_ENABLE_APP_FRAMEWORK
205
+ #define WASM_ENABLE_APP_FRAMEWORK 0
206
+ #endif
207
+
208
+ #ifndef WASM_HAVE_MREMAP
209
+ #define WASM_HAVE_MREMAP 0
210
+ #endif
211
+
212
+ /* Bulk memory operation */
213
+ #ifndef WASM_ENABLE_BULK_MEMORY
214
+ #define WASM_ENABLE_BULK_MEMORY 0
215
+ #endif
216
+
217
+ /* Shared memory */
218
+ #ifndef WASM_ENABLE_SHARED_MEMORY
219
+ #define WASM_ENABLE_SHARED_MEMORY 0
220
+ #endif
221
+
222
+ /* Thread manager */
223
+ #ifndef WASM_ENABLE_THREAD_MGR
224
+ #define WASM_ENABLE_THREAD_MGR 0
225
+ #endif
226
+
227
+ /* Source debugging */
228
+ #ifndef WASM_ENABLE_DEBUG_INTERP
229
+ #define WASM_ENABLE_DEBUG_INTERP 0
230
+ #endif
231
+
232
+ #if WASM_ENABLE_DEBUG_INTERP != 0
233
+ #ifndef DEBUG_EXECUTION_MEMORY_SIZE
234
+ /* 0x85000 is the size required by lldb, if this is changed to a smaller value,
235
+ * then the debugger will not be able to evaluate user expressions, other
236
+ * functionality such as breakpoint and stepping are not influenced by this */
237
+ #define DEBUG_EXECUTION_MEMORY_SIZE 0x85000
238
+ #endif
239
+ #endif /* end of WASM_ENABLE_DEBUG_INTERP != 0 */
240
+
241
+ #ifndef WASM_ENABLE_DEBUG_AOT
242
+ #define WASM_ENABLE_DEBUG_AOT 0
243
+ #endif
244
+
245
+ /* Custom sections */
246
+ #ifndef WASM_ENABLE_LOAD_CUSTOM_SECTION
247
+ #define WASM_ENABLE_LOAD_CUSTOM_SECTION 0
248
+ #endif
249
+
250
+ /* WASM log system */
251
+ #ifndef WASM_ENABLE_LOG
252
+ #define WASM_ENABLE_LOG 1
253
+ #endif
254
+
255
+ /* When this flag is set, WAMR will not automatically
256
+ * initialize sockets on Windows platforms. The host
257
+ * application is responsible for calling WSAStartup()
258
+ * before executing WAMR code that uses sockets, and
259
+ * calling WSACleanup() after.
260
+ * This flag passes control of socket initialization from
261
+ * WAMR to the host application. */
262
+ #ifndef WASM_ENABLE_HOST_SOCKET_INIT
263
+ #define WASM_ENABLE_HOST_SOCKET_INIT 0
264
+ #endif
265
+
266
+ #ifndef WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS
267
+ #if defined(BUILD_TARGET_X86_32) || defined(BUILD_TARGET_X86_64) \
268
+ || defined(BUILD_TARGET_AARCH64)
269
+ #define WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS 1
270
+ #else
271
+ #define WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS 0
272
+ #endif
273
+ #endif
274
+
275
+ /* WASM Interpreter labels-as-values feature */
276
+ #ifndef WASM_ENABLE_LABELS_AS_VALUES
277
+ #ifdef __GNUC__
278
+ #define WASM_ENABLE_LABELS_AS_VALUES 1
279
+ #else
280
+ #define WASM_ENABLE_LABELS_AS_VALUES 0
281
+ #endif
282
+ #endif
283
+
284
+ /* Enable fast interpreter or not */
285
+ #ifndef WASM_ENABLE_FAST_INTERP
286
+ #define WASM_ENABLE_FAST_INTERP 0
287
+ #endif
288
+
289
+ #if WASM_ENABLE_FAST_INTERP != 0
290
+ #define WASM_DEBUG_PREPROCESSOR 0
291
+ #endif
292
+
293
+ /* Enable opcode counter or not */
294
+ #ifndef WASM_ENABLE_OPCODE_COUNTER
295
+ #define WASM_ENABLE_OPCODE_COUNTER 0
296
+ #endif
297
+
298
+ /* Support a module with dependency, other modules */
299
+ #ifndef WASM_ENABLE_MULTI_MODULE
300
+ #define WASM_ENABLE_MULTI_MODULE 0
301
+ #endif
302
+
303
+ /* Enable wasm mini loader or not */
304
+ #ifndef WASM_ENABLE_MINI_LOADER
305
+ #define WASM_ENABLE_MINI_LOADER 0
306
+ #endif
307
+
308
+ /* Disable boundary check with hardware trap or not,
309
+ * enable it by default if it is supported */
310
+ #ifndef WASM_DISABLE_HW_BOUND_CHECK
311
+ #define WASM_DISABLE_HW_BOUND_CHECK 0
312
+ #endif
313
+
314
+ /* Disable native stack access boundary check with hardware
315
+ * trap or not, enable it by default if it is supported */
316
+ #ifndef WASM_DISABLE_STACK_HW_BOUND_CHECK
317
+ #define WASM_DISABLE_STACK_HW_BOUND_CHECK 0
318
+ #endif
319
+
320
+ /* Disable SIMD unless it is manually enabled somewhere */
321
+ #ifndef WASM_ENABLE_SIMD
322
+ #define WASM_ENABLE_SIMD 0
323
+ #endif
324
+
325
+ /* Disable SIMDe (used in the fast interpreter for SIMD opcodes)
326
+ unless used elsewhere */
327
+ #ifndef WASM_ENABLE_SIMDE
328
+ #define WASM_ENABLE_SIMDE 0
329
+ #endif
330
+
331
+ /* GC performance profiling */
332
+ #ifndef WASM_ENABLE_GC_PERF_PROFILING
333
+ #define WASM_ENABLE_GC_PERF_PROFILING 0
334
+ #endif
335
+
336
+ /* Memory profiling */
337
+ #ifndef WASM_ENABLE_MEMORY_PROFILING
338
+ #define WASM_ENABLE_MEMORY_PROFILING 0
339
+ #endif
340
+
341
+ /* Memory tracing */
342
+ #ifndef WASM_ENABLE_MEMORY_TRACING
343
+ #define WASM_ENABLE_MEMORY_TRACING 0
344
+ #endif
345
+
346
+ /* Performance profiling */
347
+ #ifndef WASM_ENABLE_PERF_PROFILING
348
+ #define WASM_ENABLE_PERF_PROFILING 0
349
+ #endif
350
+
351
+ /* Dump call stack */
352
+ #ifndef WASM_ENABLE_DUMP_CALL_STACK
353
+ #define WASM_ENABLE_DUMP_CALL_STACK 0
354
+ #endif
355
+
356
+ /* AOT stack frame */
357
+ #ifndef WASM_ENABLE_AOT_STACK_FRAME
358
+ #define WASM_ENABLE_AOT_STACK_FRAME 0
359
+ #endif
360
+
361
+ /* Heap verification */
362
+ #ifndef BH_ENABLE_GC_VERIFY
363
+ #define BH_ENABLE_GC_VERIFY 0
364
+ #endif
365
+
366
+ /* Heap corruption check, enabled by default */
367
+ #ifndef BH_ENABLE_GC_CORRUPTION_CHECK
368
+ #define BH_ENABLE_GC_CORRUPTION_CHECK 1
369
+ #endif
370
+
371
+ /* Enable global heap pool if heap verification is enabled */
372
+ #if BH_ENABLE_GC_VERIFY != 0
373
+ #define WASM_ENABLE_GLOBAL_HEAP_POOL 1
374
+ #endif
375
+
376
+ /* Global heap pool */
377
+ #ifndef WASM_ENABLE_GLOBAL_HEAP_POOL
378
+ #define WASM_ENABLE_GLOBAL_HEAP_POOL 0
379
+ #endif
380
+
381
+ #ifndef WASM_ENABLE_SPEC_TEST
382
+ #define WASM_ENABLE_SPEC_TEST 0
383
+ #endif
384
+
385
+ #ifndef WASM_ENABLE_WASI_TEST
386
+ #define WASM_ENABLE_WASI_TEST 0
387
+ #endif
388
+
389
+ /* Global heap pool size in bytes */
390
+ #ifndef WASM_GLOBAL_HEAP_SIZE
391
+ #define WASM_GLOBAL_HEAP_SIZE (10 * 1024 * 1024)
392
+ #endif
393
+
394
+ /* Default length of queue */
395
+ #ifndef DEFAULT_QUEUE_LENGTH
396
+ #define DEFAULT_QUEUE_LENGTH 50
397
+ #endif
398
+
399
+ /* The max percentage of global heap that app memory space can grow */
400
+ #ifndef APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT
401
+ #define APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT 1 / 3
402
+ #endif
403
+
404
+ /* Default min/max heap size of each app */
405
+ #ifndef APP_HEAP_SIZE_DEFAULT
406
+ #define APP_HEAP_SIZE_DEFAULT (8 * 1024)
407
+ #endif
408
+ #define APP_HEAP_SIZE_MIN (256)
409
+ /* The ems memory allocator supports maximal heap size 1GB,
410
+ see ems_gc_internal.h */
411
+ #define APP_HEAP_SIZE_MAX (1024 * 1024 * 1024)
412
+
413
+ /* Default min/max gc heap size of each app */
414
+ #ifndef GC_HEAP_SIZE_DEFAULT
415
+ #define GC_HEAP_SIZE_DEFAULT (128 * 1024)
416
+ #endif
417
+ #define GC_HEAP_SIZE_MIN (4 * 1024)
418
+ #define GC_HEAP_SIZE_MAX (1024 * 1024 * 1024)
419
+
420
+ /* Default wasm stack size of each app */
421
+ #if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
422
+ #define DEFAULT_WASM_STACK_SIZE (16 * 1024)
423
+ #else
424
+ #define DEFAULT_WASM_STACK_SIZE (12 * 1024)
425
+ #endif
426
+ /* Min auxiliary stack size of each wasm thread */
427
+ #define WASM_THREAD_AUX_STACK_SIZE_MIN (256)
428
+
429
+ /* Default/min native stack size of each app thread */
430
+ #if !(defined(APP_THREAD_STACK_SIZE_DEFAULT) \
431
+ && defined(APP_THREAD_STACK_SIZE_MIN))
432
+ #if defined(BH_PLATFORM_ZEPHYR) || defined(BH_PLATFORM_ALIOS_THINGS) \
433
+ || defined(BH_PLATFORM_ESP_IDF) || defined(BH_PLATFORM_OPENRTOS)
434
+ #define APP_THREAD_STACK_SIZE_DEFAULT (6 * 1024)
435
+ #define APP_THREAD_STACK_SIZE_MIN (4 * 1024)
436
+ #elif defined(PTHREAD_STACK_DEFAULT) && defined(PTHREAD_STACK_MIN)
437
+ #define APP_THREAD_STACK_SIZE_DEFAULT PTHREAD_STACK_DEFAULT
438
+ #define APP_THREAD_STACK_SIZE_MIN PTHREAD_STACK_MIN
439
+ #elif WASM_ENABLE_UVWASI != 0
440
+ /* UVWASI requires larger native stack */
441
+ #define APP_THREAD_STACK_SIZE_DEFAULT (64 * 1024)
442
+ #define APP_THREAD_STACK_SIZE_MIN (48 * 1024)
443
+ #else
444
+ #define APP_THREAD_STACK_SIZE_DEFAULT (128 * 1024)
445
+ #define APP_THREAD_STACK_SIZE_MIN (24 * 1024)
446
+ #endif
447
+ #endif /* end of !(defined(APP_THREAD_STACK_SIZE_DEFAULT) \
448
+ && defined(APP_THREAD_STACK_SIZE_MIN)) */
449
+
450
+ /* Max native stack size of each app thread */
451
+ #if !defined(APP_THREAD_STACK_SIZE_MAX)
452
+ #define APP_THREAD_STACK_SIZE_MAX (8 * 1024 * 1024)
453
+ #endif
454
+
455
+ /* Reserved bytes to the native thread stack boundary, throw native
456
+ * stack overflow exception if the guard boundary is reached
457
+ *
458
+ * WASM_STACK_GUARD_SIZE needs to be large enough for:
459
+ *
460
+ * - native functions
461
+ *
462
+ * w/o hw bound check, the overhead (aot_call_function etc) + the native
463
+ * function itself. as of writing this, the former is about 1000 bytes
464
+ * on macOS amd64.
465
+ *
466
+ * with hw bound check, theoretically, only needs to cover the logic to
467
+ * set up the jmp_buf stack.
468
+ *
469
+ * - aot runtime functions
470
+ * eg. aot_enlarge_memory.
471
+ *
472
+ * - w/o hw bound check, the interpreter loop
473
+ *
474
+ * the stack consumption heavily depends on compiler settings,
475
+ * especially for huge functions like the classic interpreter's
476
+ * wasm_interp_call_func_bytecode:
477
+ *
478
+ * 200 bytes (release build, macOS/amd64)
479
+ * 2600 bytes (debug build, macOS/amd64)
480
+ *
481
+ * - platform-provided functions (eg. libc)
482
+ *
483
+ * the following are examples of the stack consumptions observed for
484
+ * host APIs.
485
+ *
486
+ * snprintf: (used by eg. wasm_runtime_set_exception)
487
+ * - about 1600 bytes on macOS/amd64
488
+ * - about 2000 bytes on Ubuntu amd64 20.04
489
+ *
490
+ * gethostbyname:
491
+ * - 3KB-6KB on macOS/amd64
492
+ * - 10KB on Ubuntu amd64 20.04
493
+ *
494
+ * getaddrinfo:
495
+ * - 4KB-17KB on macOS/amd64
496
+ * - 12KB on Ubuntu amd64 20.04
497
+ * - 0.3-1.5KB on NuttX/esp32s3
498
+ *
499
+ * - stack check wrapper functions generated by the aot compiler
500
+ * (--stack-bounds-checks=1)
501
+ *
502
+ * wamrc issues a warning
503
+ * "precheck functions themselves consume relatively large amount of stack"
504
+ * when it detects wrapper functions requiring more than 1KB.
505
+ *
506
+ * - the ABI-defined red zone. eg. 128 bytes for SYSV x86-64 ABI.
507
+ * cf. https://en.wikipedia.org/wiki/Red_zone_(computing)
508
+ *
509
+ * Note: on platforms with lazy function binding, don't forget to consider
510
+ * the symbol resolution overhead on the first call. For example,
511
+ * on Ubuntu amd64 20.04, it seems to consume about 1500 bytes.
512
+ * For some reasons, macOS amd64 12.7.4 seems to resolve symbols eagerly.
513
+ * (Observed with a binary with traditional non-chained fixups.)
514
+ * The latest macOS seems to apply chained fixups in kernel on page-in time.
515
+ * (thus it wouldn't consume userland stack.)
516
+ */
517
+ #ifndef WASM_STACK_GUARD_SIZE
518
+ #if WASM_ENABLE_UVWASI != 0
519
+ /* UVWASI requires larger native stack */
520
+ #define WASM_STACK_GUARD_SIZE (4096 * 6)
521
+ #else
522
+ /*
523
+ * Use a larger default for platforms like macOS/Linux.
524
+ *
525
+ * For example, the classic interpreter loop which ended up with a trap
526
+ * (wasm_runtime_set_exception) would consume about 2KB stack on x86-64
527
+ * macOS. On Ubuntu amd64 20.04, it seems to consume a bit more.
528
+ *
529
+ * Although product-mini/platforms/nuttx always overrides
530
+ * WASM_STACK_GUARD_SIZE, exclude NuttX here just in case.
531
+ */
532
+ #if defined(__APPLE__) || (defined(__unix__) && !defined(__NuttX__))
533
+ #if BH_DEBUG != 0 /* assumption: BH_DEBUG matches CMAKE_BUILD_TYPE=Debug */
534
+ #define WASM_STACK_GUARD_SIZE (1024 * 5)
535
+ #else
536
+ #define WASM_STACK_GUARD_SIZE (1024 * 3)
537
+ #endif
538
+ #else
539
+ /*
540
+ * Otherwise, assume very small requirement for now.
541
+ *
542
+ * Embedders for very small devices likely fine-tune WASM_STACK_GUARD_SIZE
543
+ * for their specific applications anyway.
544
+ */
545
+ #define WASM_STACK_GUARD_SIZE 1024
546
+ #endif
547
+ #endif
548
+ #endif
549
+
550
+ /* Guard page count for stack overflow check with hardware trap */
551
+ #ifndef STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT
552
+ #if defined(__APPLE__) && defined(__aarch64__)
553
+ /* Note: on macOS/iOS arm64, the user page size is 16KB */
554
+ #define STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT 1
555
+ #else
556
+ #define STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT 3
557
+ #endif
558
+ #endif
559
+
560
+ /* Default wasm block address cache size and conflict list size */
561
+ #ifndef BLOCK_ADDR_CACHE_SIZE
562
+ #define BLOCK_ADDR_CACHE_SIZE 64
563
+ #endif
564
+ #define BLOCK_ADDR_CONFLICT_SIZE 2
565
+
566
+ /* Default max thread num per cluster. Can be overwrite by
567
+ wasm_runtime_set_max_thread_num */
568
+ #define CLUSTER_MAX_THREAD_NUM 4
569
+
570
+ #ifndef WASM_ENABLE_TAIL_CALL
571
+ #define WASM_ENABLE_TAIL_CALL 0
572
+ #endif
573
+
574
+ #ifndef WASM_ENABLE_CUSTOM_NAME_SECTION
575
+ #define WASM_ENABLE_CUSTOM_NAME_SECTION 0
576
+ #endif
577
+
578
+ #ifndef WASM_ENABLE_REF_TYPES
579
+ #define WASM_ENABLE_REF_TYPES 0
580
+ #endif
581
+
582
+ #ifndef WASM_ENABLE_GC
583
+ #define WASM_ENABLE_GC 0
584
+ #endif
585
+
586
+ #ifndef WASM_CONST_EXPR_STACK_SIZE
587
+ #if WASM_ENABLE_GC != 0
588
+ #define WASM_CONST_EXPR_STACK_SIZE 8
589
+ #else
590
+ #define WASM_CONST_EXPR_STACK_SIZE 4
591
+ #endif
592
+ #endif
593
+
594
+ #ifndef WASM_ENABLE_STRINGREF
595
+ #define WASM_ENABLE_STRINGREF 0
596
+ #endif
597
+
598
+ #ifndef GC_REFTYPE_MAP_SIZE_DEFAULT
599
+ #define GC_REFTYPE_MAP_SIZE_DEFAULT 64
600
+ #endif
601
+
602
+ #ifndef GC_RTTOBJ_MAP_SIZE_DEFAULT
603
+ #define GC_RTTOBJ_MAP_SIZE_DEFAULT 64
604
+ #endif
605
+
606
+ #ifndef WASM_ENABLE_EXCE_HANDLING
607
+ #define WASM_ENABLE_EXCE_HANDLING 0
608
+ #endif
609
+
610
+ #ifndef WASM_ENABLE_TAGS
611
+ #define WASM_ENABLE_TAGS 0
612
+ #endif
613
+
614
+ #ifndef WASM_ENABLE_SGX_IPFS
615
+ #define WASM_ENABLE_SGX_IPFS 0
616
+ #endif
617
+
618
+ #ifndef WASM_MEM_ALLOC_WITH_USER_DATA
619
+ #define WASM_MEM_ALLOC_WITH_USER_DATA 0
620
+ #endif
621
+
622
+ #ifndef WASM_ENABLE_WASM_CACHE
623
+ #define WASM_ENABLE_WASM_CACHE 0
624
+ #endif
625
+
626
+ #ifndef WASM_ENABLE_STATIC_PGO
627
+ #define WASM_ENABLE_STATIC_PGO 0
628
+ #endif
629
+
630
+ /* Disable writing linear memory base address to GS segment register,
631
+ by default only in linux x86-64, linear memory base addr is written
632
+ to GS segment register before calling wasm/aot function. */
633
+ #ifndef WASM_DISABLE_WRITE_GS_BASE
634
+ #define WASM_DISABLE_WRITE_GS_BASE 0
635
+ #endif
636
+
637
+ /* Configurable bounds checks */
638
+ #ifndef WASM_CONFIGURABLE_BOUNDS_CHECKS
639
+ #define WASM_CONFIGURABLE_BOUNDS_CHECKS 0
640
+ #endif
641
+
642
+ /* Some chip cannot support external ram with rwx attr at the same time,
643
+ it has to map it into 2 spaces of idbus and dbus, code in dbus can be
644
+ read/written and read/executed in ibus. so there are 2 steps to execute
645
+ the code, first, copy & do relocation in dbus space, and second execute
646
+ it in ibus space, since in the 2 spaces the contents are the same,
647
+ so we call it bus mirror.
648
+ */
649
+ #ifndef WASM_MEM_DUAL_BUS_MIRROR
650
+ #define WASM_MEM_DUAL_BUS_MIRROR 0
651
+ #endif
652
+
653
+ /* The max number of module instance contexts. */
654
+ #ifndef WASM_MAX_INSTANCE_CONTEXTS
655
+ #define WASM_MAX_INSTANCE_CONTEXTS 8
656
+ #endif
657
+
658
+ /* linux perf support */
659
+ #ifndef WASM_ENABLE_LINUX_PERF
660
+ #define WASM_ENABLE_LINUX_PERF 0
661
+ #endif
662
+
663
+ /* Support registering quick AOT/JIT function entries of some func types
664
+ to speed up the calling process of invoking the AOT/JIT functions of
665
+ these types from the host embedder */
666
+ #ifndef WASM_ENABLE_QUICK_AOT_ENTRY
667
+ #define WASM_ENABLE_QUICK_AOT_ENTRY 1
668
+ #endif
669
+
670
+ /* Support AOT intrinsic functions which can be called from the AOT code
671
+ when `--disable-llvm-intrinsics` flag or
672
+ `--enable-builtin-intrinsics=<intr1,intr2,...>` is used by wamrc to
673
+ generate the AOT file */
674
+ #ifndef WASM_ENABLE_AOT_INTRINSICS
675
+ #define WASM_ENABLE_AOT_INTRINSICS 1
676
+ #endif
677
+
678
+ /* Disable memory64 by default */
679
+ #ifndef WASM_ENABLE_MEMORY64
680
+ #define WASM_ENABLE_MEMORY64 0
681
+ #endif
682
+
683
+ /* Disable multi-memory by default */
684
+ #ifndef WASM_ENABLE_MULTI_MEMORY
685
+ #define WASM_ENABLE_MULTI_MEMORY 0
686
+ #endif
687
+
688
+ #ifndef WASM_TABLE_MAX_SIZE
689
+ #define WASM_TABLE_MAX_SIZE 1024
690
+ #endif
691
+
692
+ #ifndef WASM_MEM_ALLOC_WITH_USAGE
693
+ #define WASM_MEM_ALLOC_WITH_USAGE 0
694
+ #endif
695
+
696
+ #ifndef WASM_ENABLE_FUZZ_TEST
697
+ #define WASM_ENABLE_FUZZ_TEST 0
698
+ #endif
699
+
700
+ #if WASM_ENABLE_FUZZ_TEST != 0
701
+ #ifndef WASM_MEM_ALLOC_MAX_SIZE
702
+ /* In oss-fuzz, the maximum RAM is ~2.5G */
703
+ #define WASM_MEM_ALLOC_MAX_SIZE (2U * 1024 * 1024 * 1024)
704
+ #endif
705
+ #endif /* WASM_ENABLE_FUZZ_TEST != 0 */
706
+
707
+ #ifndef WASM_ENABLE_SHARED_HEAP
708
+ #define WASM_ENABLE_SHARED_HEAP 0
709
+ #endif
710
+
711
+ #ifndef WASM_ENABLE_SHRUNK_MEMORY
712
+ #define WASM_ENABLE_SHRUNK_MEMORY 1
713
+ #endif
714
+
715
+ #ifndef WASM_ENABLE_AOT_VALIDATOR
716
+ #define WASM_ENABLE_AOT_VALIDATOR 0
717
+ #endif
718
+
719
+ #ifndef WASM_ENABLE_INSTRUCTION_METERING
720
+ #define WASM_ENABLE_INSTRUCTION_METERING 0
721
+ #endif
722
+
723
+ #ifndef WASM_ENABLE_EXTENDED_CONST_EXPR
724
+ #define WASM_ENABLE_EXTENDED_CONST_EXPR 0
725
+ #endif
726
+
727
+ #endif /* end of _CONFIG_H_ */