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

ruby-changes:5647

From: akr <ko1@a...>
Date: Sat, 14 Jun 2008 07:57:59 +0900 (JST)
Subject: [ruby-changes:5647] Ruby:r17154 (trunk): * gc.c (ruby_initial_gc_stress): defined.

akr	2008-06-14 07:57:41 +0900 (Sat, 14 Jun 2008)

  New Revision: 17154

  Modified files:
    trunk/ChangeLog
    trunk/debug.c
    trunk/gc.c

  Log:
    * gc.c (ruby_initial_gc_stress): defined.
      (ruby_initial_gc_stress_ptr): defined.
    
    * debug.c (set_debug_option): use ruby_initial_gc_stress_ptr for
      gc_stress option.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17154&r2=17153&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/gc.c?r1=17154&r2=17153&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/debug.c?r1=17154&r2=17153&diff_format=u

Index: debug.c
===================================================================
--- debug.c	(revision 17153)
+++ debug.c	(revision 17154)
@@ -141,13 +141,13 @@
 #define SET_WHEN(name, var) do {	    \
 	if (len == sizeof(name) - 1 &&	    \
 	    strncmp(str, name, len) == 0) { \
-	    extern int ruby_##var;	    \
-	    ruby_##var = 1;		    \
+	    extern int var;	    \
+	    var = 1;		    \
 	    return;			    \
 	}				    \
     } while (0)
-    SET_WHEN("gc_stress", gc_stress);
-    SET_WHEN("core", enable_coredump);
+    SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr);
+    SET_WHEN("core", ruby_enable_coredump);
     fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
 }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17153)
+++ ChangeLog	(revision 17154)
@@ -1,3 +1,11 @@
+Sat Jun 14 07:52:53 2008  Tanaka Akira  <akr@f...>
+
+	* gc.c (ruby_initial_gc_stress): defined.
+	  (ruby_initial_gc_stress_ptr): defined.
+
+	* debug.c (set_debug_option): use ruby_initial_gc_stress_ptr for
+	  gc_stress option.
+
 Sat Jun 14 00:09:19 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* gc.c (ruby_gc_stress): moved to rb_objspace_t.
Index: gc.c
===================================================================
--- gc.c	(revision 17153)
+++ gc.c	(revision 17154)
@@ -184,8 +184,11 @@
 
 #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
 #define rb_objspace (*GET_VM()->objspace)
+static int ruby_initial_gc_stress = 0;
+int *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
 #else
 static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
+int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
 #endif
 #define malloc_limit		objspace->malloc_params.limit
 #define malloc_increase 	objspace->malloc_params.increase
@@ -216,6 +219,7 @@
     rb_objspace_t *objspace = malloc(sizeof(rb_objspace_t));
     memset(objspace, 0, sizeof(*objspace));
     malloc_limit = GC_MALLOC_LIMIT;
+    ruby_gc_stress = ruby_initial_gc_stress;
 
     return objspace;
 }

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

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