From dbe8886f4d28d9e5a01d3667cd451a623c3c1ccc Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 21 Mar 2024 14:24:06 -0400 Subject: [PATCH] Remove deprecated function rb_gc_force_recycle This function has been deprecated since Ruby 3.1, so we should remove it for Ruby 3.4. --- NEWS.md | 4 +++- gc.c | 6 ------ include/ruby/internal/gc.h | 16 ---------------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/NEWS.md b/NEWS.md index 131cf104ad4ed1..e8c80d295ea8ce 100644 --- a/NEWS.md +++ b/NEWS.md @@ -103,7 +103,8 @@ See GitHub releases like [GitHub Releases of Logger](https://github.com/ruby/log ## C API updates -* `rb_newobj` and `rb_newobj_of` (and corresponding macros `RB_NEWOBJ`, `RB_NEWOBJ_OF`, `NEWOBJ`, `NEWOBJ_OF`) have been removed [[Feature #20265]]. +* `rb_newobj` and `rb_newobj_of` (and corresponding macros `RB_NEWOBJ`, `RB_NEWOBJ_OF`, `NEWOBJ`, `NEWOBJ_OF`) have been removed. [[Feature #20265]] +* Removed deprecated function `rb_gc_force_recycle`. [[Feature #18290]] ## Implementation improvements @@ -113,6 +114,7 @@ See GitHub releases like [GitHub Releases of Logger](https://github.com/ruby/log [Feature #13557]: https://bugs.ruby-lang.org/issues/13557 [Feature #16495]: https://bugs.ruby-lang.org/issues/16495 +[Feature #18290]: https://bugs.ruby-lang.org/issues/18290 [Feature #18980]: https://bugs.ruby-lang.org/issues/18980 [Feature #19117]: https://bugs.ruby-lang.org/issues/19117 [Bug #19918]: https://bugs.ruby-lang.org/issues/19918 diff --git a/gc.c b/gc.c index 6c83c5d0ad23ab..0edd5ed1927e73 100644 --- a/gc.c +++ b/gc.c @@ -8765,12 +8765,6 @@ rb_gc_ractor_newobj_cache_clear(rb_ractor_newobj_cache_t *newobj_cache) } } -void -rb_gc_force_recycle(VALUE obj) -{ - /* no-op */ -} - void rb_gc_register_mark_object(VALUE obj) { diff --git a/include/ruby/internal/gc.h b/include/ruby/internal/gc.h index ac9dfd8842ebe3..f36ec1590e4524 100644 --- a/include/ruby/internal/gc.h +++ b/include/ruby/internal/gc.h @@ -209,22 +209,6 @@ void rb_gc_mark_movable(VALUE obj); */ VALUE rb_gc_location(VALUE obj); -/** - * Asserts that the passed object is no longer needed. Such objects are - * reclaimed sooner or later so this function is not mandatory. But sometimes - * you can know from your application knowledge that an object is surely dead - * at some point. Calling this as a hint can be a polite way. - * - * @param[out] obj Object, dead. - * @pre `obj` have never been passed to this function before. - * @post `obj` could be invalidated. - * @warning It is a failure to pass an object multiple times to this - * function. - * @deprecated This is now a no-op function. - */ -RBIMPL_ATTR_DEPRECATED(("this is now a no-op function")) -void rb_gc_force_recycle(VALUE obj); - /** * Triggers a GC process. This was the only GC entry point that we had at the * beginning. Over time our GC evolved. Now what this function does is just a