summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2025-04-11 16:02:23 -0700
committerJohn Hawthorn <[email protected]>2025-05-02 14:28:25 -0700
commit36c64b3be83f17992137d63ffd0b94f90e24424a (patch)
treebc0d9ff749350d32e2bf139a54280dc29666fdff
parent23000c7339298d8888e161dcf11ad62c9053e180 (diff)
Also prefer FL_TEST_RAW in gc.c
Similar to 4a040eeb0d880b67a5005cce382122fd5b629b99, I noticed the test for FL_FINALIZE checking FL_ABLE in a profile, and we shouldn't need to do that here.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13233
-rw-r--r--gc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gc.c b/gc.c
index 6e4c7ff74b..3f5bc5cea5 100644
--- a/gc.c
+++ b/gc.c
@@ -1216,14 +1216,14 @@ rb_data_free(void *objspace, VALUE obj)
void
rb_gc_obj_free_vm_weak_references(VALUE obj)
{
- if (FL_TEST(obj, FL_EXIVAR)) {
+ if (FL_TEST_RAW(obj, FL_EXIVAR)) {
rb_free_generic_ivar((VALUE)obj);
FL_UNSET(obj, FL_EXIVAR);
}
switch (BUILTIN_TYPE(obj)) {
case T_STRING:
- if (FL_TEST(obj, RSTRING_FSTR)) {
+ if (FL_TEST_RAW(obj, RSTRING_FSTR)) {
rb_gc_free_fstring(obj);
}
break;
@@ -1458,7 +1458,7 @@ rb_gc_obj_free(void *objspace, VALUE obj)
BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags);
}
- if (FL_TEST(obj, FL_FINALIZE)) {
+ if (FL_TEST_RAW(obj, FL_FINALIZE)) {
rb_gc_impl_make_zombie(objspace, obj, 0, 0);
return FALSE;
}
@@ -2665,7 +2665,7 @@ rb_gc_mark_roots(void *objspace, const char **categoryp)
void
rb_gc_mark_children(void *objspace, VALUE obj)
{
- if (FL_TEST(obj, FL_EXIVAR)) {
+ if (FL_TEST_RAW(obj, FL_EXIVAR)) {
rb_mark_generic_ivar(obj);
}
@@ -2700,7 +2700,7 @@ rb_gc_mark_children(void *objspace, VALUE obj)
switch (BUILTIN_TYPE(obj)) {
case T_CLASS:
- if (FL_TEST(obj, FL_SINGLETON)) {
+ if (FL_TEST_RAW(obj, FL_SINGLETON)) {
gc_mark_internal(RCLASS_ATTACHED_OBJECT(obj));
}
// Continue to the shared T_CLASS/T_MODULE
@@ -3635,7 +3635,7 @@ rb_gc_update_object_references(void *objspace, VALUE obj)
{
switch (BUILTIN_TYPE(obj)) {
case T_CLASS:
- if (FL_TEST(obj, FL_SINGLETON)) {
+ if (FL_TEST_RAW(obj, FL_SINGLETON)) {
UPDATE_IF_MOVED(objspace, RCLASS_ATTACHED_OBJECT(obj));
}
// Continue to the shared T_CLASS/T_MODULE