diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-15 13:21:24 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-15 13:21:24 +0000 |
commit | a3071ea4e38eeccc4d7e7eba3394ef7483b3cbcc (patch) | |
tree | ef4266fe483b8dd0eaf2de63f72b89d6c7eb3e4c /vm_core.h | |
parent | 25d56ea7b7b52dc81af30c92a9a0e2d2dab6ff27 (diff) |
remove rb_thread_t::event_hooks.
* vm_core.h (rb_thread_t): remove rb_thread_t::event_hooks.
* vm_trace.c: all hooks are connected to vm->event_hooks and
add rb_event_hook_t::filter::th to filter invoke thread.
It will simplify invoking hooks code.
* thread.c (thread_start_func_2): clear thread specific trace_func.
* test/ruby/test_settracefunc.rb: add a test for Thread#add_trace_func.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -845,9 +845,6 @@ typedef struct rb_thread_struct { /* statistics data for profiler */ VALUE stat_insn_usage; - /* tracer */ - rb_hook_list_t event_hooks; - /* fiber */ rb_fiber_t *root_fiber; rb_jmpbuf_t root_jmpbuf; @@ -1723,9 +1720,9 @@ static inline void rb_exec_event_hook_orig(rb_execution_context_t *ec, const rb_event_flag_t flag, VALUE self, ID id, ID called_id, VALUE klass, VALUE data, int pop_p) { - const rb_thread_t *th = rb_ec_thread_ptr(ec); + const rb_vm_t *vm = rb_ec_vm_ptr(ec); - if ((th->event_hooks.events | th->vm->event_hooks.events) & flag) { + if (vm->event_hooks.events & flag) { struct rb_trace_arg_struct trace_arg; trace_arg.event = flag; trace_arg.ec = ec; |