* 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
This commit is contained in:
ko1 2013-10-22 10:54:44 +00:00
parent d6fe84b6f3
commit 3d85d6edb5
2 changed files with 23 additions and 22 deletions

View File

@ -1,3 +1,8 @@
Tue Oct 22 19:53:16 2013 Koichi Sasada <ko1@atdot.net>
* gc.c (Init_heap): move logics from heap_pages_init() and remove
heap_pages_init().
Tue Oct 22 19:19:05 2013 Koichi Sasada <ko1@atdot.net>
* gc.c: allow multiple heaps.

40
gc.c
View File

@ -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 *);