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

ruby-changes:34546

From: nobu <ko1@a...>
Date: Mon, 30 Jun 2014 23:59:54 +0900 (JST)
Subject: [ruby-changes:34546] nobu:r46627 (trunk): gc.c: freeze GC::OPTS

nobu	2014-06-30 23:59:46 +0900 (Mon, 30 Jun 2014)

  New Revision: 46627

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

  Log:
    gc.c: freeze GC::OPTS
    
    * gc.c (Init_GC): freeze GC::OPTS.

  Modified files:
    trunk/gc.c
Index: gc.c
===================================================================
--- gc.c	(revision 46626)
+++ gc.c	(revision 46627)
@@ -7830,7 +7830,7 @@ Init_GC(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L7830
     {
 	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))
+#define OPT(o) if (o) rb_ary_push(opts, rb_fstring_new(#o, strlen(#o)))
 	OPT(GC_DEBUG);
 	OPT(USE_RGENGC);
 	OPT(RGENGC_DEBUG);
@@ -7845,5 +7845,6 @@ Init_GC(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L7845
 	OPT(MALLOC_ALLOCATED_SIZE_CHECK);
 	OPT(GC_PROFILE_DETAIL_MEMORY);
 #undef OPT
+	OBJ_FREEZE(opts);
     }
 }

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

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