Co-authored-by: vargaz <vargaz@users.noreply.github.com>
#include <mono/utils/mono-mmap.h>
#include <emscripten.h>
+#include <emscripten/stack.h>
#include <glib.h>
#define round_down(addr, val) ((void*)((addr) & ~((val) - 1)))
static int
wasm_get_stack_base (void)
{
- // Return the bottom limit of the stack
- return EM_ASM_INT ({
- return STACK_MAX;
- });
+ return emscripten_stack_get_end ();
}
EMSCRIPTEN_KEEPALIVE
static int
wasm_get_stack_size (void)
{
- return EM_ASM_INT ({
- return TOTAL_STACK;
- });
+ return (guint8*)emscripten_stack_get_base () - (guint8*)emscripten_stack_get_end ();
}
int