Skip to content

Commit

Permalink
wasm: cleanup strict stack checking extra function
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
  • Loading branch information
rockwotj committed May 2, 2024
1 parent 146adab commit f069ef9
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions src/v/wasm/wasmtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -895,37 +895,6 @@ struct host_function<module_func> {
handle<wasm_functype_t, wasm_functype_delete> functype{
wasm_functype_new(&inputs, &outputs)};

if (ssc.enabled()) {
if constexpr (ss::is_future<ReturnType>::value) {
handle<wasmtime_error_t, wasmtime_error_delete> error(
wasmtime_linker_define_async_func(
linker,
Module::name.data(),
Module::name.size(),
function_name.data(),
function_name.size(),
functype.get(),
&invoke_async_host_fn_with_strict_stack_checking,
/*data=*/ssc.allocator,
/*finalizer=*/nullptr));
check_error(error.get());
} else {
handle<wasmtime_error_t, wasmtime_error_delete> error(
wasmtime_linker_define_func(
linker,
Module::name.data(),
Module::name.size(),
function_name.data(),
function_name.size(),
functype.get(),
&invoke_sync_host_fn_with_strict_stack_checking,
/*data=*/ssc.allocator,
/*finalizer=*/nullptr));
check_error(error.get());
}
return;
}

if constexpr (ss::is_future<ReturnType>::value) {
handle<wasmtime_error_t, wasmtime_error_delete> error(
wasmtime_linker_define_async_func(
Expand All @@ -935,8 +904,9 @@ struct host_function<module_func> {
function_name.data(),
function_name.size(),
functype.get(),
&invoke_async_host_fn,
/*data=*/nullptr,
ssc.enabled() ? &invoke_async_host_fn_with_strict_stack_checking
: &invoke_async_host_fn,
/*data=*/ssc.allocator,
/*finalizer=*/nullptr));
check_error(error.get());
} else {
Expand All @@ -948,8 +918,9 @@ struct host_function<module_func> {
function_name.data(),
function_name.size(),
functype.get(),
&invoke_sync_host_fn,
/*data=*/nullptr,
ssc.enabled() ? &invoke_sync_host_fn_with_strict_stack_checking
: &invoke_sync_host_fn,
/*data=*/ssc.allocator,
/*finalizer=*/nullptr));
check_error(error.get());
}
Expand Down

0 comments on commit f069ef9

Please sign in to comment.