summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/vm_core.h b/vm_core.h
index 5fa11487f7..a5ba1900c1 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -101,7 +101,13 @@
#endif
#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
-#define USE_SIGALTSTACK
+# define USE_SIGALTSTACK
+void *rb_register_sigaltstack(void);
+# define RB_ALTSTACK_INIT(var) var = rb_register_sigaltstack()
+# define RB_ALTSTACK_FREE(var) xfree(var)
+#else /* noop */
+# define RB_ALTSTACK_INIT(var)
+# define RB_ALTSTACK_FREE(var)
#endif
/*****************/
@@ -538,6 +544,9 @@ typedef struct rb_vm_struct {
struct rb_thread_struct *main_thread;
struct rb_thread_struct *running_thread;
+#ifdef USE_SIGALTSTACK
+ void *main_altstack;
+#endif
rb_serial_t fork_gen;
struct list_head waiting_fds; /* <=> struct waiting_fd */
@@ -883,9 +892,6 @@ typedef struct rb_thread_struct {
/* misc */
unsigned int abort_on_exception: 1;
unsigned int report_on_exception: 1;
-#ifdef USE_SIGALTSTACK
- void *altstack;
-#endif
uint32_t running_time_us; /* 12500..800000 */
VALUE name;
} rb_thread_t;