Skip to content

Commit

Permalink
small refactor and bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TianlongLiang committed Mar 13, 2024
1 parent c3e33a9 commit 27cc41c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/iwasm/aot/aot_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ bh_static_assert(offsetof(AOTModuleInstance, func_type_indexes)
bh_static_assert(offsetof(AOTModuleInstance, cur_exception)
== 13 * sizeof(uint64));
bh_static_assert(offsetof(AOTModuleInstance, c_api_func_imports)
== 13 * sizeof(uint64) + 128 + 8 * sizeof(uint64));
== 13 * sizeof(uint64) + 128 + 7 * sizeof(uint64));
bh_static_assert(offsetof(AOTModuleInstance, global_table_data)
== 13 * sizeof(uint64) + 128 + 14 * sizeof(uint64));

bh_static_assert(sizeof(AOTMemoryInstance) == 112);
bh_static_assert(sizeof(AOTMemoryInstance) == 120);
bh_static_assert(offsetof(AOTTableInstance, elems) == 24);

bh_static_assert(offsetof(AOTModuleInstanceExtra, stack_sizes) == 0);
Expand Down
6 changes: 3 additions & 3 deletions core/iwasm/interpreter/wasm_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ struct WASMMemoryInstance {
DefPointer(uint8 *, heap_data_end);
/* The heap created */
DefPointer(void *, heap_handle);
/* TODO: use it replace the g_shared_memory_lock */
DefPointer(korp_mutex *, shared_memory_lock);

#if WASM_ENABLE_FAST_JIT != 0 || WASM_ENABLE_JIT != 0 \
|| WASM_ENABLE_WAMR_COMPILER != 0 || WASM_ENABLE_AOT != 0
Expand Down Expand Up @@ -405,8 +407,6 @@ struct WASMModuleInstance {
it denotes `AOTModule *` */
DefPointer(WASMModule *, module);

DefPointer(void *, used_to_be_wasi_ctx); /* unused */

DefPointer(WASMExecEnv *, exec_env_singleton);
/* Array of function pointers to import functions,
not available in AOTModuleInstance */
Expand Down Expand Up @@ -434,7 +434,7 @@ struct WASMModuleInstance {

/* Default WASM operand stack size */
uint32 default_wasm_stack_size;
uint32 reserved[5];
uint32 reserved[7];

/*
* +------------------------------+ <-- memories
Expand Down
4 changes: 2 additions & 2 deletions language-bindings/go/wamr/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (self *Module) SetWasiArgsEx(dirList [][]byte, mapDirList [][]byte,
C.wasm_runtime_set_wasi_args_ex(self.module, dirPtr, dirCount,
mapDirPtr, mapDirCount,
envPtr, envCount, argvPtr, argc,
C.int(stdinfd), C.int(stdoutfd),
C.int(stderrfd))
C.long(stdinfd), C.long(stdoutfd),
C.long(stderrfd))
}

/* Set module's wasi network address pool */
Expand Down

0 comments on commit 27cc41c

Please sign in to comment.