From db67572243c37792d9500edaf6f4a8076d883f4e Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Fri, 7 Feb 2025 10:50:21 +0000 Subject: [PATCH] Avoid calling `rb_ext_ractor_safe` on 2.x Rubies Can you tell it's Friday? --- ext/datadog_profiling_native_extension/profiling.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/datadog_profiling_native_extension/profiling.c b/ext/datadog_profiling_native_extension/profiling.c index e6143533eef..40b7af5466a 100644 --- a/ext/datadog_profiling_native_extension/profiling.c +++ b/ext/datadog_profiling_native_extension/profiling.c @@ -43,7 +43,9 @@ static VALUE _native_safe_object_info(DDTRACE_UNUSED VALUE _self, VALUE obj); void DDTRACE_EXPORT Init_datadog_profiling_native_extension(void) { // The profiler still has a lot of limitations around being used in Ractors BUT for now we're choosing to take care of those // on our side, rather than asking Ruby to block calling our APIs from Ractors. - rb_ext_ractor_safe(true); + #ifdef HAVE_RB_EXT_RACTOR_SAFE + rb_ext_ractor_safe(true); + #endif VALUE datadog_module = rb_define_module("Datadog"); VALUE profiling_module = rb_define_module_under(datadog_module, "Profiling");