summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-03-08 10:45:59 +0000
committerMatt Valentine-House <matt@eightbitraptor.com>2023-03-15 21:26:26 +0000
commit4ae9c34a4e00d148f206affb3a65926bf3fe230f (patch)
tree7b99d39dd7d5d910917fc46817004945434323a9 /internal
parent60b8c7d9fd2e2cb82dae7189a66335b3bec9005f (diff)
downloadruby-4ae9c34a4e00d148f206affb3a65926bf3fe230f.tar.gz
Move RB_VM_SAVE_MACHINE_CONTEXT to internal/thread.h
Diffstat (limited to 'internal')
-rw-r--r--internal/thread.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/thread.h b/internal/thread.h
index 2bcc2d242e..7bb4b77a86 100644
--- a/internal/thread.h
+++ b/internal/thread.h
@@ -13,6 +13,13 @@
struct rb_thread_struct; /* in vm_core.h */
+#define RB_VM_SAVE_MACHINE_CONTEXT(th) \
+ do { \
+ FLUSH_REGISTER_WINDOWS; \
+ setjmp((th)->ec->machine.regs); \
+ SET_MACHINE_STACK_END(&(th)->ec->machine.stack_end); \
+ } while (0)
+
/* thread.c */
#define COVERAGE_INDEX_LINES 0
#define COVERAGE_INDEX_BRANCHES 1