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

ruby-changes:31465

From: ko1 <ko1@a...>
Date: Wed, 6 Nov 2013 07:14:02 +0900 (JST)
Subject: [ruby-changes:31465] ko1:r43544 (trunk): * gc.c (Init_GC): add GC::OPTS to show options.

ko1	2013-11-06 07:13:51 +0900 (Wed, 06 Nov 2013)

  New Revision: 43544

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

  Log:
    * gc.c (Init_GC): add GC::OPTS to show options.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43543)
+++ ChangeLog	(revision 43544)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Nov  6 07:13:18 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (Init_GC): add GC::OPTS to show options.
+
 Wed Nov  6 07:12:17 2013  Koichi Sasada  <ko1@a...>
 
 	* benchmark/gc/gcbench.rb: add some options to make quiet.
Index: gc.c
===================================================================
--- gc.c	(revision 43543)
+++ gc.c	(revision 43544)
@@ -6827,4 +6827,23 @@ Init_GC(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L6827
     rb_define_singleton_method(rb_mGC, "malloc_allocated_size", gc_malloc_allocated_size, 0);
     rb_define_singleton_method(rb_mGC, "malloc_allocations", gc_malloc_allocations, 0);
 #endif
+
+    /* ::GC::OPTS, which shows GC build options */
+    {
+	VALUE opts;
+	rb_define_const(rb_mGC, "OPTS", opts = rb_ary_new());
+#define OPT(o) if (o) rb_ary_push(opts, rb_str_new2(#o))
+	OPT(GC_DEBUG);
+	OPT(USE_RGENGC);
+	OPT(RGENGC_DEBUG);
+	OPT(RGENGC_CHECK_MODE);
+	OPT(RGENGC_PROFILE);
+	OPT(RGENGC_THREEGEN);
+	OPT(RGENGC_ESTIMATE_OLDSPACE);
+	OPT(GC_PROFILE_MORE_DETAIL);
+	OPT(GC_ENABLE_LAZY_SWEEP);
+	OPT(CALC_EXACT_MALLOC_SIZE);
+	OPT(CALC_EXACT_MALLOC_SIZE_CHECK_OLD_SIZE);
+#undef OPT
+    }
 }

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

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