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

ruby-changes:16123

From: tarui <ko1@a...>
Date: Sun, 30 May 2010 01:33:16 +0900 (JST)
Subject: [ruby-changes:16123] Ruby:r28078 (trunk): * thread.c (RB_GC_SAVE_MACHINE_CONTEXT): start GC

tarui	2010-05-30 01:32:59 +0900 (Sun, 30 May 2010)

  New Revision: 28078

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

  Log:
    * thread.c (RB_GC_SAVE_MACHINE_CONTEXT): start GC 
      by switching the thread if gc_stress == true 
    
    * gc.c (ruby_gc_stress_start): dotto.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 28077)
+++ ChangeLog	(revision 28078)
@@ -1,3 +1,10 @@
+Sun May 30 01:25:48 2010  Masaya Tarui  <tarui@r...>
+
+	* thread.c (RB_GC_SAVE_MACHINE_CONTEXT): start GC 
+	  by switching the thread if gc_stress == true 
+
+	* gc.c (ruby_gc_stress_start): dotto.
+
 Sun May 30 00:02:39 2010  Yusuke Endoh  <mame@t...>
 
 	* gc.c (force_chain_object, rb_objspace_call_finalizer): delete
Index: thread.c
===================================================================
--- thread.c	(revision 28077)
+++ thread.c	(revision 28078)
@@ -99,10 +99,13 @@
 
 static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region);
 
+void ruby_gc_stress_start(void);
+
 #define RB_GC_SAVE_MACHINE_CONTEXT(th) \
   do { \
     rb_gc_save_machine_context(th); \
     SET_MACHINE_STACK_END(&(th)->machine_stack_end); \
+    ruby_gc_stress_start(); \
   } while (0)
 
 #define GVL_UNLOCK_BEGIN() do { \
Index: gc.c
===================================================================
--- gc.c	(revision 28077)
+++ gc.c	(revision 28078)
@@ -517,6 +517,14 @@
     return ruby_gc_stress ? Qtrue : Qfalse;
 }
 
+void 
+ruby_gc_stress_start(void)
+{
+    rb_objspace_t *objspace = &rb_objspace;
+    if(ruby_gc_stress)
+	rb_gc();
+}
+
 /*
  *  call-seq:
  *    GC.stress = bool          -> bool

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

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