summaryrefslogtreecommitdiff
diff options
authorYusuke Endoh <[email protected]>2025-07-16 19:34:16 +0900
committerYusuke Endoh <[email protected]>2025-07-16 20:14:20 +0900
commit830ab2c5b5ea58d1f29cb5e9b3864626b9dc8592 (patch)
tree822a0cc3922a5937a0d0744accdb502c902c1e4d
parentdedf9f5f621f4f9b72b3b40be1753791b7de974e (diff)
Add a comment to count_objects to prevent future regressionHEADmaster
-rw-r--r--gc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 10bce22639..7558637555 100644
--- a/gc.c
+++ b/gc.c
@@ -2507,6 +2507,9 @@ count_objects(int argc, VALUE *argv, VALUE os)
}
for (size_t i = 0; i <= T_MASK; i++) {
+ // type_sym can allocate an object,
+ // so we need to create all key symbols in advance
+ // not to disturb the result
types[i] = type_sym(i);
}
close