summaryrefslogtreecommitdiff
path: root/method.h
diff options
context:
space:
mode:
authorLuke Gruber <luke.gruber@shopify.com>2025-12-16 14:06:55 -0500
committerGitHub <noreply@github.com>2025-12-16 14:06:55 -0500
commit4fb537b1ee28bb37dbe551ac65c279d436c756bc (patch)
tree03a8f339cb53f6b9b0b359af0d50bdcbc5eefcc9 /method.h
parentd209e6f1c0a93ad3ce1cc64dd165a6b67672614d (diff)
Make tracepoints with set_trace_func or TracePoint.new ractor local (#15468)
Before this change, GC'ing any Ractor object caused you to lose all enabled tracepoints across all ractors (even main). Now tracepoints are ractor-local and this doesn't happen. Internal events are still global. Fixes [Bug #19112]
Diffstat (limited to 'method.h')
-rw-r--r--method.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/method.h b/method.h
index b174c6fccb..260344d53b 100644
--- a/method.h
+++ b/method.h
@@ -166,8 +166,8 @@ typedef struct rb_method_refined_struct {
typedef struct rb_method_bmethod_struct {
VALUE proc; /* should be marked */
- struct rb_hook_list_struct *hooks;
rb_serial_t defined_ractor_id;
+ unsigned int local_hooks_cnt;
} rb_method_bmethod_t;
enum method_optimized_type {
@@ -208,6 +208,8 @@ struct rb_method_definition_struct {
};
struct rb_id_table;
+struct rb_ractor_struct;
+struct rb_hook_list_struct;
typedef struct rb_method_definition_struct rb_method_definition_t;
STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8);
@@ -267,5 +269,8 @@ void rb_vm_delete_cc_refinement(const struct rb_callcache *cc);
void rb_clear_method_cache(VALUE klass_or_module, ID mid);
void rb_clear_all_refinement_method_cache(void);
void rb_invalidate_method_caches(struct rb_id_table *cm_tbl, VALUE cc_tbl);
+struct rb_hook_list_struct *rb_method_def_local_hooks(rb_method_definition_t *def, struct rb_ractor_struct *cr, bool create);
+void rb_method_definition_addref(rb_method_definition_t *def);
+void rb_method_definition_release(rb_method_definition_t *def);
#endif /* RUBY_METHOD_H */