Deprecate rb_gc_force_recycle#4363
Merged
peterzhu2118 merged 2 commits intoruby:masterfrom Nov 8, 2021
Merged
Conversation
a2ee0c4 to
ebc2cc6
Compare
shyouhei
reviewed
Nov 7, 2021
include/ruby/internal/intern/gc.h
Outdated
Comment on lines
+211
to
+213
| * @deprecated This is now a no-op function, use RB_GC_GUARD instead. | ||
| */ | ||
| RBIMPL_ATTR_DEPRECATED(("this is now a no-op function, use RB_GC_GUARD instead")) |
Member
There was a problem hiding this comment.
The "use RB_GC_GUARD instead" advice can be unsought. People might not understand why they should use RB_GC_GUARD instead of it. In fact they don't have to, unless they are Eric Wong. It seems nobody except Eric could be creative enough to abuse this function as a GC guard.
Member
Author
There was a problem hiding this comment.
That's a good point. I've updated the message to not include that suggestion.
This commit removes usages of rb_gc_force_recycle since it is a burden to maintain and makes changes to the GC difficult.
ebc2cc6 to
49dbf0a
Compare
ko1
reviewed
Nov 8, 2021
gc.c
Outdated
| */ | ||
| } | ||
| RB_VM_LOCK_LEAVE(); | ||
| RB_GC_GUARD(obj); |
Member
Author
There was a problem hiding this comment.
Good catch. I don't think it's needed.
ko1
approved these changes
Nov 8, 2021
…mark_stack_chunk This commit deprecates rb_gc_force_recycle and coverts it to a no-op function. Also removes invalidate_mark_stack_chunk since only rb_gc_force_recycle uses it.
49dbf0a to
ba92b0d
Compare
Contributor
|
Could you add about this change on NEWS? (sorry I missed it before merging) |
Member
Author
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm proposing to deprecate
rb_gc_force_recycleand make it a no-op function because it is a burden to maintain and makes changes to the GC difficult. It is also easy to incorrectly use this function and cause memory leaks such as #18065.