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

ruby-changes:38312

From: nobu <ko1@a...>
Date: Sun, 26 Apr 2015 08:45:10 +0900 (JST)
Subject: [ruby-changes:38312] nobu:r50393 (trunk): vm_trace.c: not a static variable

nobu	2015-04-26 08:45:02 +0900 (Sun, 26 Apr 2015)

  New Revision: 50393

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

  Log:
    vm_trace.c: not a static variable
    
    * vm_trace.c (symbol2event_flag): should not be static but a mere
      local variable, so that unnecessary race condition does not
      happen.

  Modified files:
    trunk/vm_trace.c
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 50392)
+++ vm_trace.c	(revision 50393)
@@ -682,7 +682,7 @@ tp_alloc(VALUE klass) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L682
 static rb_event_flag_t
 symbol2event_flag(VALUE v)
 {
-    static ID id;
+    ID id;
     VALUE sym = rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym");
 
 #define C(name, NAME) CONST_ID(id, #name); if (sym == ID2SYM(id)) return RUBY_EVENT_##NAME

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

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