Skip to content

Commit

Permalink
[NO-TICKET] Do not reference rb_gc_force_recycle on Ruby 3.1+
Browse files Browse the repository at this point in the history
**What does this PR do?**

This PR avoids referencing `rb_gc_force_recycle` on Rubies where this
method is a no-op.

**Motivation:**

This method will be removed in Ruby 3.4
( ruby/ruby#10324 ) so we should stop
referencing it.

**Additional Notes:**

N/A

**How to test the change?**

Validate that CI is still green.
  • Loading branch information
ivoanjo committed Apr 9, 2024
1 parent 10971eb commit 9e33136
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/datadog_profiling_native_extension/stack_recorder.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,9 @@ static VALUE _native_debug_heap_recorder(DDTRACE_UNUSED VALUE _self, VALUE recor
// This method exists only to enable testing Datadog::Profiling::StackRecorder behavior using RSpec.
// It SHOULD NOT be used for other purposes.
static VALUE _native_gc_force_recycle(DDTRACE_UNUSED VALUE _self, VALUE obj) {
rb_gc_force_recycle(obj);
#ifdef HAVE_WORKING_RB_GC_FORCE_RECYCLE
rb_gc_force_recycle(obj);
#endif
return Qnil;
}
#pragma GCC diagnostic pop
Expand Down

0 comments on commit 9e33136

Please sign in to comment.