1#include "wasm/machine.h"
2#include "wasm/setjmp.h"
4#include "wasm/asyncify.h"
7int rb_wasm_rt_start(
int (main)(
int argc,
char **argv),
int argc,
char **argv) {
11 bool new_fiber_started =
false;
12 void *arg0 = NULL, *arg1 = NULL;
13 void (*fiber_entry_point)(
void *,
void *) = NULL;
16 if (fiber_entry_point) {
17 fiber_entry_point(arg0, arg1);
19 result = main(argc, argv);
22 extern void *rb_asyncify_unwind_buf;
25 if (rb_asyncify_unwind_buf == NULL) {
31 asyncify_stop_unwind();
33 if ((
asyncify_buf = rb_wasm_handle_jmp_unwind()) != NULL) {
37 if ((
asyncify_buf = rb_wasm_handle_scan_unwind()) != NULL) {
42 asyncify_buf = rb_wasm_handle_fiber_unwind(&fiber_entry_point, &arg0, &arg1, &new_fiber_started);
47 }
else if (new_fiber_started) {