summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index 3f2b52420f..c627a91bcf 100644
--- a/vm.c
+++ b/vm.c
@@ -1761,7 +1761,7 @@ thread_free(void *ptr)
else {
#ifdef USE_SIGALTSTACK
if (th->altstack) {
- xfree(th->altstack);
+ free(th->altstack);
}
#endif
ruby_xfree(ptr);
@@ -1834,7 +1834,8 @@ th_init(rb_thread_t *th, VALUE self)
/* allocate thread stack */
#ifdef USE_SIGALTSTACK
- th->altstack = xmalloc(ALT_STACK_SIZE);
+ /* altstack of main thread is reallocated in another place */
+ th->altstack = malloc(ALT_STACK_SIZE);
#endif
th->stack_size = RUBY_VM_THREAD_STACK_SIZE;
th->stack = thread_recycle_stack(th->stack_size);