Fix some coding style issues, fix doc typo and refine some codes (#392)

This commit is contained in:
Wenyong Huang
2020-09-20 08:20:45 +08:00
committed by GitHub
parent 7c8ccc7c26
commit e501a6963b
20 changed files with 155 additions and 227 deletions

View File

@ -2202,9 +2202,9 @@ interp_process_export(wasm_store_t *store,
external = wasm_global_as_extern(global);
break;
// TODO:
case EXPORT_KIND_MEMORY:
case EXPORT_KIND_TABLE:
/* TODO: */
break;
default:
goto failed;

View File

@ -31,9 +31,9 @@ typedef enum runtime_mode_e {
} runtime_mode_e;
struct wasm_engine_t {
// support one store for now
/* support one store for now */
wasm_store_vec_t *stores;
// Interpreter by deault
/* Interpreter by deault */
runtime_mode_e mode;
};
@ -49,21 +49,21 @@ struct wasm_valtype_t {
struct wasm_functype_t {
uint32 extern_kind;
// gona to new and delete own
/* gona to new and delete own */
wasm_valtype_vec_t *params;
wasm_valtype_vec_t *results;
};
struct wasm_globaltype_t {
uint32 extern_kind;
// gona to new and delete own
/* gona to new and delete own */
wasm_valtype_t *val_type;
wasm_mutability_t mutability;
};
struct wasm_tabletype_t {
uint32 extern_kind;
// always be WASM_FUNCREF
/* always be WASM_FUNCREF */
wasm_valtype_t *type;
wasm_limits_t *limits;
};

View File

@ -791,6 +791,7 @@ wasm_runtime_destroy_exec_env(WASMExecEnv *exec_env)
wasm_exec_env_destroy(exec_env);
}
#if (WASM_ENABLE_MEMORY_PROFILING != 0) || (WASM_ENABLE_MEMORY_TRACING != 0)
void
wasm_runtime_dump_module_mem_consumption(const WASMModuleCommon *module)
{
@ -872,7 +873,6 @@ wasm_runtime_dump_exec_env_mem_consumption(const WASMExecEnv *exec_env)
os_printf(" stack size: %u\n", exec_env->wasm_stack_size);
}
#if WASM_ENABLE_MEMORY_PROFILING != 0
uint32
gc_get_heap_highmark_size(void *heap);
@ -951,7 +951,8 @@ wasm_runtime_dump_mem_consumption(WASMExecEnv *exec_env)
os_printf("Total app heap used: %u\n", app_heap_peak_size);
}
#endif
#endif /* end of (WASM_ENABLE_MEMORY_PROFILING != 0)
|| (WASM_ENABLE_MEMORY_TRACING != 0) */
WASMModuleInstanceCommon *
wasm_runtime_get_module_inst(WASMExecEnv *exec_env)
@ -2645,7 +2646,7 @@ wasm_runtime_invoke_native_raw(WASMExecEnv *exec_env, void *func_ptr,
}
}
ret = true;
ret = !wasm_runtime_get_exception(module) ? true : false;
fail:
if (argv1 != argv_buf)
@ -2900,7 +2901,7 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
}
exec_env->attachment = NULL;
ret = true;
ret = !wasm_runtime_get_exception(module) ? true : false;
fail:
if (argv1 != argv_buf)
@ -3053,7 +3054,7 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
}
exec_env->attachment = NULL;
ret = true;
ret = !wasm_runtime_get_exception(module) ? true : false;
fail:
if (argv1 != argv_buf)
@ -3231,7 +3232,7 @@ wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
}
exec_env->attachment = NULL;
ret = true;
ret = !wasm_runtime_get_exception(module) ? true : false;
fail:
if (argv1 != argv_buf)
wasm_runtime_free(argv1);