Ruby: wasm/machine.h Source File

Ruby 3.4.4p34 (2025-05-14 revision a38531fd3f617bf734ef7d6c595325f69985ea1d)

machine.h
1#ifndef RB_WASM_SUPPORT_MACHINE_H
2#define RB_WASM_SUPPORT_MACHINE_H
3
4// Function pointer used as scan callbacks
5typedef void (*rb_wasm_scan_func)(void*, void*);
6
7// Scan WebAssembly locals in the all call stack (like registers) spilled by Asyncify
8// Used by conservative GC
9void rb_wasm_scan_locals(rb_wasm_scan_func scan);
10
11// Get base address of userland C-stack memory space in WebAssembly. Used by conservative GC
12void *rb_wasm_stack_get_base(void);
13
14
15// Get the current stack pointer
16void *rb_wasm_get_stack_pointer(void);
17
18// Set the current stack pointer
19void rb_wasm_set_stack_pointer(void *sp);
20
21// Returns the Asyncify buffer of next rewinding if unwound for spilling locals.
22// Used by the top level Asyncify handling in wasm/runtime.c
23void *rb_wasm_handle_scan_unwind(void);
24
25#endif