summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-20 01:44:41 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-22 00:03:00 +0900
commit02d9524cdaca1754718bf1d591408d377e6b383a (patch)
treea88d9042c69513af9fe6e3a6f1f74505e5955a15 /vm_core.h
parenta2950369bd8a5866092f6badf59b0811653a6092 (diff)
separate rb_ractor_pub from rb_ractor_t
separate some fields from rb_ractor_t to rb_ractor_pub and put it at the beggining of rb_ractor_t and declare it in vm_core.h so vm_core.h can access rb_ractor_pub fields. Now rb_ec_ractor_hooks() is a complete inline function and no MJIT related issue.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3943
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/vm_core.h b/vm_core.h
index e86026ab50..f6b81b57c6 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1970,18 +1970,17 @@ rb_exec_event_hook_orig(rb_execution_context_t *ec, rb_hook_list_t *hooks, rb_ev
rb_exec_event_hooks(&trace_arg, hooks, pop_p);
}
-rb_hook_list_t *rb_ractor_hooks(rb_ractor_t *cr);;
+struct rb_ractor_pub {
+ VALUE self;
+ uint32_t id;
+ rb_hook_list_t hooks;
+};
static inline rb_hook_list_t *
rb_ec_ractor_hooks(const rb_execution_context_t *ec)
{
- rb_hook_list_t *hooks = rb_ractor_hooks(rb_ec_ractor_ptr(ec));
- if (LIKELY(hooks == NULL)) {
- return NULL;
- }
- else {
- return hooks;
- }
+ struct rb_ractor_pub *cr_pub = (struct rb_ractor_pub *)rb_ec_ractor_ptr(ec);
+ return &cr_pub->hooks;
}
#define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_) \