[前][次][番号順一覧][スレッド一覧]

ruby-changes:31310

From: ko1 <ko1@a...>
Date: Tue, 22 Oct 2013 19:54:49 +0900 (JST)
Subject: [ruby-changes:31310] ko1:r43389 (trunk): * gc.c (Init_heap): move logics from heap_pages_init() and remove

ko1	2013-10-22 19:54:44 +0900 (Tue, 22 Oct 2013)

  New Revision: 43389

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43389

  Log:
    * gc.c (Init_heap): move logics from heap_pages_init() and remove
      heap_pages_init().

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43388)
+++ ChangeLog	(revision 43389)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Oct 22 19:53:16 2013  Koichi Sasada  <ko1@a...>
+
+	* 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@a...>
 
 	* gc.c: allow multiple heaps.
Index: gc.c
===================================================================
--- gc.c	(revision 43388)
+++ gc.c	(revision 43389)
@@ -893,27 +893,6 @@ heap_add_pages(rb_objspace_t *objspace, https://github.com/ruby/ruby/blob/trunk/gc.c#L893
 }
 
 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 https://github.com/ruby/ruby/blob/trunk/gc.c#L1396
 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 *);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]