summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-07-18 10:11:53 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-07-21 10:58:30 -0400
commita2e165e8a03b4d20282dec0655c9971cd2d460fa (patch)
tree4c6508fc9ffad7b2ee423c17cee3e6d6ef044bb7 /gc.c
parent2bcb155b49bb421ee82c0d5980546a5071113407 (diff)
Remove dsymbol_fstr_hash
We don't need to delay the freeing of the fstr for the symbol if we store the hash of the fstr in the dynamic symbol and we use compare-by-identity for removing the dynamic symbol from the sym_set.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gc.c b/gc.c
index 5c298de0b1..cdc8891d7c 100644
--- a/gc.c
+++ b/gc.c
@@ -3168,11 +3168,6 @@ rb_gc_mark_children(void *objspace, VALUE obj)
switch (BUILTIN_TYPE(obj)) {
case T_FLOAT:
case T_BIGNUM:
- case T_SYMBOL:
- /* Not immediates, but does not have references and singleton class.
- *
- * RSYMBOL(obj)->fstr intentionally not marked. See log for 96815f1e
- * ("symbol.c: remove rb_gc_mark_symbols()") */
return;
case T_NIL:
@@ -3230,6 +3225,10 @@ rb_gc_mark_children(void *objspace, VALUE obj)
mark_hash(obj);
break;
+ case T_SYMBOL:
+ gc_mark_internal(RSYMBOL(obj)->fstr);
+ break;
+
case T_STRING:
if (STR_SHARED_P(obj)) {
if (STR_EMBED_P(RSTRING(obj)->as.heap.aux.shared)) {