ruby-changes:38313
From: nobu <ko1@a...>
Date: Sun, 26 Apr 2015 08:55:42 +0900 (JST)
Subject: [ruby-changes:38313] nobu:r50394 (trunk): vm_trace.c: unified a_call and a_return
nobu 2015-04-26 08:55:34 +0900 (Sun, 26 Apr 2015) New Revision: 50394 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50394 Log: vm_trace.c: unified a_call and a_return * vm_trace.c (symbol2event_flag): use a uniform macro for a_call and a_return too. Modified files: trunk/vm_trace.c Index: vm_trace.c =================================================================== --- vm_trace.c (revision 50393) +++ vm_trace.c (revision 50394) @@ -684,6 +684,10 @@ symbol2event_flag(VALUE v) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L684 { ID id; VALUE sym = rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym"); + const rb_event_flag_t RUBY_EVENT_A_CALL = + RUBY_EVENT_CALL | RUBY_EVENT_B_CALL | RUBY_EVENT_C_CALL; + const rb_event_flag_t RUBY_EVENT_A_RETURN = + RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN | RUBY_EVENT_C_RETURN; #define C(name, NAME) CONST_ID(id, #name); if (sym == ID2SYM(id)) return RUBY_EVENT_##NAME C(line, LINE); @@ -699,9 +703,9 @@ symbol2event_flag(VALUE v) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L703 C(thread_begin, THREAD_BEGIN); C(thread_end, THREAD_END); C(specified_line, SPECIFIED_LINE); + C(a_call, A_CALL); + C(a_return, A_RETURN); #undef C - CONST_ID(id, "a_call"); if (sym == ID2SYM(id)) return RUBY_EVENT_CALL | RUBY_EVENT_B_CALL | RUBY_EVENT_C_CALL; - CONST_ID(id, "a_return"); if (sym == ID2SYM(id)) return RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN | RUBY_EVENT_C_RETURN; rb_raise(rb_eArgError, "unknown event: %"PRIsVALUE, rb_sym2str(sym)); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/