@@ -21,6 +21,7 @@ static char **app_argv;
2121static int
2222print_help ()
2323{
24+ /* clang-format off */
2425 printf ("Usage: iwasm [-options] wasm_file [args...]\n" );
2526 printf ("options:\n" );
2627 printf (" -f|--function name Specify a function name of the module to run rather\n"
@@ -46,6 +47,7 @@ print_help()
4647#if WASM_ENABLE_LIB_PTHREAD != 0
4748 printf (" --max-threads=n Set maximum thread number per cluster, default is 4\n" );
4849#endif
50+ /* clang-format on */
4951 return 1 ;
5052}
5153
@@ -89,10 +91,8 @@ validate_env_str(char *env)
8991}
9092#endif
9193
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 };
9696#endif
9797
9898#if WASM_ENABLE_MULTI_MODULE != 0
@@ -105,12 +105,13 @@ handle_module_path(const char *module_path)
105105
106106static char * module_search_path = "." ;
107107static bool
108- module_reader_callback (const char * module_name , uint8 * * p_buffer ,
108+ module_reader_callback (const char * module_name ,
109+ uint8 * * p_buffer ,
109110 uint32 * p_size )
110111{
111112 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 ;
114115 char * wasm_file_name = BH_MALLOC (sz );
115116 if (!wasm_file_name ) {
116117 return false;
@@ -245,7 +246,7 @@ main(int argc, char *argv[])
245246
246247 memset (& init_args , 0 , sizeof (RuntimeInitArgs ));
247248
248- #if USE_GLOBAL_HEAP_BUF != 0
249+ #if WASM_ENABLE_GLOBAL_HEAP_POOL != 0
249250 init_args .mem_alloc_type = Alloc_With_Pool ;
250251 init_args .mem_alloc_option .pool .heap_buf = global_heap_buf ;
251252 init_args .mem_alloc_option .pool .heap_size = sizeof (global_heap_buf );
0 commit comments