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

ruby-changes:31952

From: ko1 <ko1@a...>
Date: Fri, 6 Dec 2013 16:22:32 +0900 (JST)
Subject: [ruby-changes:31952] ko1:r44031 (trunk): * gc.c (gc_start_internal): do not use rb_gc_start() and rb_gc().

ko1	2013-12-06 16:22:25 +0900 (Fri, 06 Dec 2013)

  New Revision: 44031

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

  Log:
    * gc.c (gc_start_internal): do not use rb_gc_start() and rb_gc().

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44030)
+++ ChangeLog	(revision 44031)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Dec  6 16:16:30 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (gc_start_internal): do not use rb_gc_start() and rb_gc().
+
 Fri Dec  6 15:24:30 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_start_internal, rb_gc): do not need
Index: gc.c
===================================================================
--- gc.c	(revision 44030)
+++ gc.c	(revision 44031)
@@ -5019,23 +5019,22 @@ gc_start_internal(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/gc.c#L5019
     static VALUE keyword_syms[2];
 
     rb_scan_args(argc, argv, "0:", &opt);
-    if (NIL_P(opt)) {
-	return rb_gc_start();
-    }
 
-    if (!keyword_ids[0]) {
-	keyword_ids[0] = rb_intern("full_mark");
-	keyword_ids[1] = rb_intern("immediate_sweep");
-	keyword_syms[0] = ID2SYM(keyword_ids[0]);
-	keyword_syms[1] = ID2SYM(keyword_ids[1]);
-    }
+    if (!NIL_P(opt)) {
+	if (!keyword_ids[0]) {
+	    keyword_ids[0] = rb_intern("full_mark");
+	    keyword_ids[1] = rb_intern("immediate_sweep");
+	    keyword_syms[0] = ID2SYM(keyword_ids[0]);
+	    keyword_syms[1] = ID2SYM(keyword_ids[1]);
+	}
 
-    rb_check_keyword_opthash(opt, keyword_ids, 0, 2);
+	rb_check_keyword_opthash(opt, keyword_ids, 0, 2);
 
-    if ((kwval = rb_hash_lookup2(opt, keyword_syms[0], Qundef)) != Qundef)
-	full_mark = RTEST(kwval);
-    if ((kwval = rb_hash_lookup2(opt, keyword_syms[1], Qundef)) != Qundef)
-	immediate_sweep = RTEST(kwval);
+	if ((kwval = rb_hash_lookup2(opt, keyword_syms[0], Qundef)) != Qundef)
+	  full_mark = RTEST(kwval);
+	if ((kwval = rb_hash_lookup2(opt, keyword_syms[1], Qundef)) != Qundef)
+	  immediate_sweep = RTEST(kwval);
+    }
 
     garbage_collect(objspace, full_mark, immediate_sweep, GPR_FLAG_METHOD);
     if (!finalizing) finalize_deferred(objspace);

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

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