aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-20 21:38:27 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-20 21:38:27 +0000
commit3d223db2aa8a995a49758d07f9228f678786746e (patch)
tree569c6a6db871c4e762b293038ed456afbcf36c1c /gc.c
parent56f7905fec865874bef67d93c05035e4e5bd946b (diff)
downloadruby-3d223db2aa8a995a49758d07f9228f678786746e.tar.gz
simplify altstack and enable reuse with thread cache
Instead of allocating and registering the altstack in different places, do it together to reduce code and improve readability. When thread cache is enabled, storing altstack in rb_thread_t is wasteful and we may reuse altstack in the same pthread. This also lets us clearly allow use of xmalloc to allow GC to recover from ENOMEM. [ruby-core:85621] [Feature #14487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/gc.c b/gc.c
index b0c9041948..b9c1305060 100644
--- a/gc.c
+++ b/gc.c
@@ -2403,16 +2403,6 @@ Init_heap(void)
heap_add_pages(objspace, heap_eden, gc_params.heap_init_slots / HEAP_PAGE_OBJ_LIMIT);
init_mark_stack(&objspace->mark_stack);
-#ifdef USE_SIGALTSTACK
- {
- /* altstack of another threads are allocated in another place */
- rb_thread_t *th = GET_THREAD();
- void *tmp = th->altstack;
- th->altstack = malloc(rb_sigaltstack_size());
- free(tmp); /* free previously allocated area */
- }
-#endif
-
objspace->profile.invoke_time = getrusage_time();
finalizer_table = st_init_numtable();
}