Skip to content

Commit

Permalink
feat: destroy_tvm_emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
krigga committed Aug 14, 2024
1 parent 05afdab commit 6043780
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion emulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if (USE_EMSCRIPTEN)
add_executable(emulator-emscripten ${EMULATOR_EMSCRIPTEN_SOURCE})
target_link_libraries(emulator-emscripten PUBLIC emulator)
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_RUNTIME_METHODS=UTF8ToString,stringToUTF8,allocate,ALLOC_NORMAL,lengthBytesUTF8)
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_FUNCTIONS=_emulate,_free,_run_get_method,_setup_sbs_get_method,_sbs_step,_sbs_get_stack,_sbs_get_code_pos,_sbs_get_method_result,_create_emulator,_destroy_emulator,_emulate_sbs,_em_sbs_step,_em_sbs_stack,_em_sbs_code_pos,_em_sbs_result,_emulate_with_emulator,_version)
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_FUNCTIONS=_emulate,_free,_run_get_method,_setup_sbs_get_method,_sbs_step,_sbs_get_stack,_sbs_get_code_pos,_sbs_get_method_result,_create_emulator,_destroy_emulator,_emulate_sbs,_em_sbs_step,_em_sbs_stack,_em_sbs_code_pos,_em_sbs_result,_emulate_with_emulator,_version,_destroy_tvm_emulator)
target_link_options(emulator-emscripten PRIVATE -sEXPORT_NAME=EmulatorModule)
target_link_options(emulator-emscripten PRIVATE -sERROR_ON_UNDEFINED_SYMBOLS=0)
target_link_options(emulator-emscripten PRIVATE -Oz)
Expand Down
4 changes: 4 additions & 0 deletions emulator/emulator-emscripten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ void *setup_sbs_get_method(const char *params, const char* stack, const char* co
return tvm;
}

void destroy_tvm_emulator(void *tvm) {
tvm_emulator_destroy(tvm);
}

bool sbs_step(void *tvm) {
return tvm_emulator_sbs_step(tvm);
}
Expand Down

0 comments on commit 6043780

Please sign in to comment.