summaryrefslogtreecommitdiff
path: root/gc.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 /gc.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 'gc.c')
-rw-r--r--gc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 8c33323e9b..fb74b0623a 100644
--- a/gc.c
+++ b/gc.c
@@ -1085,6 +1085,14 @@ static void
init_heap(rb_objspace_t *objspace)
{
add_heap_slots(objspace, HEAP_MIN_SLOTS / HEAP_OBJ_LIMIT);
+#ifdef USE_SIGALTSTACK
+ {
+ /* altstack of another threads are allocated in another place */
+ rb_thread_t *th = GET_THREAD();
+ free(th->altstack); /* free previously allocated area */
+ th->altstack = xmalloc(ALT_STACK_SIZE);
+ }
+#endif
heaps_inc = 0;
objspace->profile.invoke_time = getrusage_time();