diff --git a/gc.c b/gc.c index f91d1e3c7a..46551f4558 100644 --- a/gc.c +++ b/gc.c @@ -1654,15 +1654,14 @@ rb_objspace_set_event_hook(const rb_event_flag_t event) } static void -gc_event_hook_body(rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data) +gc_event_hook_body(rb_thread_t *th, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data) { - rb_thread_t *th = GET_THREAD(); EXEC_EVENT_HOOK(th, event, th->cfp->self, 0, 0, data); } #define gc_event_hook(objspace, event, data) do { \ if (UNLIKELY((objspace)->hook_events & (event))) { \ - gc_event_hook_body((objspace), (event), (data)); \ + gc_event_hook_body(GET_THREAD(), (objspace), (event), (data)); \ } \ } while (0)