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

ruby-changes:42042

From: nobu <ko1@a...>
Date: Tue, 15 Mar 2016 16:02:13 +0900 (JST)
Subject: [ruby-changes:42042] nobu:r54116 (trunk): gc.c: mark_stack_locations

nobu	2016-03-15 16:02:09 +0900 (Tue, 15 Mar 2016)

  New Revision: 54116

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54116

  Log:
    gc.c: mark_stack_locations
    
    * gc.c (mark_stack_locations): extract the common part from
      mark_current_machine_context and rb_gc_mark_machine_stack.

  Modified files:
    trunk/gc.c
Index: gc.c
===================================================================
--- gc.c	(revision 54115)
+++ gc.c	(revision 54116)
@@ -4109,6 +4109,9 @@ mark_const_tbl(rb_objspace_t *objspace, https://github.com/ruby/ruby/blob/trunk/gc.c#L4109
      ((start) = STACK_END, (end) = STACK_START) : ((start) = STACK_START, (end) = STACK_END+(appendix)))
 #endif
 
+static void mark_stack_locations(rb_objspace_t *objspace, rb_thread_t *th,
+				 const VALUE *stack_start, const VALUE *stack_end);
+
 static void
 mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
 {
@@ -4130,17 +4133,7 @@ mark_current_machine_context(rb_objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L4133
 
     mark_locations_array(objspace, save_regs_gc_mark.v, numberof(save_regs_gc_mark.v));
 
-    gc_mark_locations(objspace, stack_start, stack_end);
-#ifdef __ia64
-    gc_mark_locations(objspace,
-		      th->machine.register_stack_start,
-		      th->machine.register_stack_end);
-#endif
-#if defined(__mc68000__)
-    gc_mark_locations(objspace,
-		      (VALUE*)((char*)stack_start + 2),
-		      (VALUE*)((char*)stack_end - 2));
-#endif
+    mark_stack_locations(objspace, th, stack_start, stack_end);
 }
 
 void
@@ -4150,6 +4143,14 @@ rb_gc_mark_machine_stack(rb_thread_t *th https://github.com/ruby/ruby/blob/trunk/gc.c#L4143
     VALUE *stack_start, *stack_end;
 
     GET_STACK_BOUNDS(stack_start, stack_end, 0);
+    mark_stack_locations(objspace, th, stack_start, stack_end);
+}
+
+static void
+mark_stack_locations(rb_objspace_t *objspace, rb_thread_t *th,
+		     const VALUE *stack_start, const VALUE *stack_end)
+{
+
     gc_mark_locations(objspace, stack_start, stack_end);
 #ifdef __ia64
     gc_mark_locations(objspace,

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

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