@@ -519,4 +519,8 @@
#define WASM_MAX_INSTANCE_CONTEXTS 8
#endif
+#ifndef WASM_TABLE_MAX_SIZE
+#define WASM_TABLE_MAX_SIZE 1024
+#endif
+
#endif /* end of _CONFIG_H_ */
@@ -94,8 +94,6 @@ typedef void *table_elem_type_t;
#define REF_CELL_NUM ((uint32)sizeof(uintptr_t) / sizeof(uint32))
-#define TABLE_MAX_SIZE (1024)
-
#define INIT_EXPR_TYPE_I32_CONST 0x41
#define INIT_EXPR_TYPE_I64_CONST 0x42
#define INIT_EXPR_TYPE_F32_CONST 0x43
@@ -1500,8 +1500,9 @@ fail:
static void
adjust_table_max_size(uint32 init_size, uint32 max_size_flag, uint32 *max_size)
{
- uint32 default_max_size =
- init_size * 2 > TABLE_MAX_SIZE ? init_size * 2 : TABLE_MAX_SIZE;
+ uint32 default_max_size = init_size * 2 > WASM_TABLE_MAX_SIZE
+ ? init_size * 2
+ : WASM_TABLE_MAX_SIZE;
if (max_size_flag) {
/* module defines the table limitation */
@@ -440,8 +440,9 @@ load_type_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,