Hi,

At Fri, 21 Jul 2006 14:04:41 +0900,
Kent Sibilev wrote in [ruby-core:08330]:
> Does this patch make any sense?

Seems good, but extracting BLOCK always by Data_Get_Struct()
might be less efficient a little.


Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.616.2.185 diff -p -U 2 -r1.616.2.185 eval.c --- eval.c 24 Jul 2006 13:04:39 -0000 1.616.2.185 +++ eval.c 30 Jul 2006 02:50:37 -0000 @@ -5839,5 +5839,13 @@ rb_call0(klass, recv, id, oid, argc, arg case NODE_BMETHOD: ruby_frame->flags |= FRAME_DMETH; + if (event_hooks) { + struct BLOCK *data; + Data_Get_Struct(body->nd_cval, struct BLOCK, data); + EXEC_EVENT_HOOK(RUBY_EVENT_CALL, data->body, recv, id, klass); + } result = proc_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv, klass); + if (event_hooks) { + EXEC_EVENT_HOOK(RUBY_EVENT_RETURN, body, recv, id, klass); + } break;
-- Nobu Nakada