@@ -21,6 +21,7 @@ static char **app_argv;
21
21
static int
22
22
print_help ()
23
23
{
24
+ /* clang-format off */
24
25
printf ("Usage: iwasm [-options] wasm_file [args...]\n" );
25
26
printf ("options:\n" );
26
27
printf (" -f|--function name Specify a function name of the module to run rather\n"
@@ -46,6 +47,7 @@ print_help()
46
47
#if WASM_ENABLE_LIB_PTHREAD != 0
47
48
printf (" --max-threads=n Set maximum thread number per cluster, default is 4\n" );
48
49
#endif
50
+ /* clang-format on */
49
51
return 1 ;
50
52
}
51
53
@@ -89,10 +91,8 @@ validate_env_str(char *env)
89
91
}
90
92
#endif
91
93
92
- #define USE_GLOBAL_HEAP_BUF 1
93
-
94
- #if USE_GLOBAL_HEAP_BUF != 0
95
- static char global_heap_buf [164 * 1024 ] = { 0 };
94
+ #if WASM_ENABLE_GLOBAL_HEAP_POOL != 0
95
+ static char global_heap_buf [WASM_GLOBAL_HEAP_SIZE * BH_KB ] = { 0 };
96
96
#endif
97
97
98
98
#if WASM_ENABLE_MULTI_MODULE != 0
@@ -105,12 +105,13 @@ handle_module_path(const char *module_path)
105
105
106
106
static char * module_search_path = "." ;
107
107
static bool
108
- module_reader_callback (const char * module_name , uint8 * * p_buffer ,
108
+ module_reader_callback (const char * module_name ,
109
+ uint8 * * p_buffer ,
109
110
uint32 * p_size )
110
111
{
111
112
const char * format = "%s/%s.wasm" ;
112
- int sz = strlen (module_search_path ) + strlen ("/" ) + strlen (module_name ) +
113
- strlen (".wasm" ) + 1 ;
113
+ int sz = strlen (module_search_path ) + strlen ("/" ) + strlen (module_name )
114
+ + strlen (".wasm" ) + 1 ;
114
115
char * wasm_file_name = BH_MALLOC (sz );
115
116
if (!wasm_file_name ) {
116
117
return false;
@@ -245,7 +246,7 @@ main(int argc, char *argv[])
245
246
246
247
memset (& init_args , 0 , sizeof (RuntimeInitArgs ));
247
248
248
- #if USE_GLOBAL_HEAP_BUF != 0
249
+ #if WASM_ENABLE_GLOBAL_HEAP_POOL != 0
249
250
init_args .mem_alloc_type = Alloc_With_Pool ;
250
251
init_args .mem_alloc_option .pool .heap_buf = global_heap_buf ;
251
252
init_args .mem_alloc_option .pool .heap_size = sizeof (global_heap_buf );
0 commit comments