summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-03-07 18:13:46 +0000
committerMatt Valentine-House <matt@eightbitraptor.com>2023-03-15 21:26:26 +0000
commit5791aa6263f730e3b2c8d4a4fb7a054539cf6135 (patch)
tree82a936cc7f543096c81094fbdde864608ba9799f /vm_core.h
parentde174681f7db3cc84ee8c55cafe89bb85a77e945 (diff)
downloadruby-5791aa6263f730e3b2c8d4a4fb7a054539cf6135.tar.gz
Move RB_GC_SAVE_MACHINE_CONTEXT to vm_core.h
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index 724c8cd739..e44a3936af 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1819,6 +1819,13 @@ RUBY_EXTERN unsigned int ruby_vm_event_local_num;
#define GET_THREAD() rb_current_thread()
#define GET_EC() rb_current_execution_context(true)
+#define RB_GC_SAVE_MACHINE_CONTEXT(th) \
+ do { \
+ FLUSH_REGISTER_WINDOWS; \
+ setjmp((th)->ec->machine.regs); \
+ SET_MACHINE_STACK_END(&(th)->ec->machine.stack_end); \
+ } while (0)
+
static inline rb_thread_t *
rb_ec_thread_ptr(const rb_execution_context_t *ec)
{