summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-02 13:08:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-02 13:08:45 +0000
commit027a15e9582d62fbd2df7efcdd2e8475be758583 (patch)
tree42bbab499be069b97f11c4c2db0bd19ebe381912 /vm.c
parent2cf05e587951f189db69278f7ee3a8ba4b8d64fe (diff)
* gc.c (init_heap): allocate sigaltstack after heaps are allocated.
[ruby-dev:44315] [Bug #5139] * vm.c (thread_free): use free because objspace is not ready. * vm.c (th_init): use malloc because objspace is not ready. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 bf01444757..a057b6bb30 100644
--- a/vm.c
+++ b/vm.c
@@ -1755,7 +1755,7 @@ thread_free(void *ptr)
else {
#ifdef USE_SIGALTSTACK
if (th->altstack) {
- xfree(th->altstack);
+ free(th->altstack);
}
#endif
ruby_xfree(ptr);
@@ -1828,7 +1828,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);