From 5eb3efcf2de300e4ad1d3ce5de8ea756063b9a28 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 3 Apr 2025 08:31:13 -0700 Subject: [PATCH] Fix timeline_value not being marked in test T_DATA with a NULL pointer are not marked. Let's wrap 1 instead to ensure that our mark function is actually run. --- ext/-test-/thread/instrumentation/instrumentation.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/-test-/thread/instrumentation/instrumentation.c b/ext/-test-/thread/instrumentation/instrumentation.c index d81bc0f2a7..25e2902a78 100644 --- a/ext/-test-/thread/instrumentation/instrumentation.c +++ b/ext/-test-/thread/instrumentation/instrumentation.c @@ -6,7 +6,6 @@ # define RB_THREAD_LOCAL_SPECIFIER #endif -static VALUE last_thread = Qnil; static VALUE timeline_value = Qnil; struct thread_event { @@ -211,9 +210,8 @@ Init_instrumentation(void) VALUE mBug = rb_define_module("Bug"); VALUE klass = rb_define_module_under(mBug, "ThreadInstrumentation"); rb_global_variable(&timeline_value); - timeline_value = TypedData_Wrap_Struct(0, &event_timeline_type, 0); + timeline_value = TypedData_Wrap_Struct(0, &event_timeline_type, (void *)1); - rb_global_variable(&last_thread); rb_define_singleton_method(klass, "register_callback", thread_register_callback, 1); rb_define_singleton_method(klass, "unregister_callback", thread_unregister_callback, 0); rb_define_singleton_method(klass, "register_and_unregister_callbacks", thread_register_and_unregister_callback, 0);