summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-22 10:54:44 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-22 10:54:44 +0000
commit3d85d6edb5064848fea9a27727eb0a7a6d525417 (patch)
tree8127b56f9c06196aacf33a690ce2755add24130e /gc.c
parentd6fe84b6f3694211ec7b6746c02018cb04a82a86 (diff)
* gc.c (Init_heap): move logics from heap_pages_init() and remove
heap_pages_init(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/gc.c b/gc.c
index e017386dbe..30e5be0a5e 100644
--- a/gc.c
+++ b/gc.c
@@ -893,27 +893,6 @@ heap_add_pages(rb_objspace_t *objspace, rb_heap_t *heap, size_t add)
}
static void
-heap_pages_init(rb_objspace_t *objspace)
-{
- heap_add_pages(objspace, heap_eden, initial_heap_min_slots / HEAP_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();
-}
-
-static void
heap_pages_set_increment(rb_objspace_t *objspace)
{
size_t next_used_limit = (size_t)(heap_pages_used * initial_growth_factor);
@@ -1417,7 +1396,24 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
void
Init_heap(void)
{
- heap_pages_init(&rb_objspace);
+ rb_objspace_t *objspace = &rb_objspace;
+
+ heap_add_pages(objspace, heap_eden, initial_heap_min_slots / HEAP_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();
}
typedef int each_obj_callback(void *, void *, size_t, void *);