diff --git a/ChangeLog b/ChangeLog index c05d643087..575fd60e73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Oct 22 19:53:16 2013 Koichi Sasada + + * gc.c (Init_heap): move logics from heap_pages_init() and remove + heap_pages_init(). + Tue Oct 22 19:19:05 2013 Koichi Sasada * gc.c: allow multiple heaps. diff --git a/gc.c b/gc.c index e017386dbe..30e5be0a5e 100644 --- a/gc.c +++ b/gc.c @@ -892,27 +892,6 @@ heap_add_pages(rb_objspace_t *objspace, rb_heap_t *heap, size_t add) heap_pages_increment = 0; } -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) { @@ -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 *);