Skip to content

Commit 035dd79

Browse files
committed
Add a comment to count_objects to prevent future regression
1 parent dedf9f5 commit 035dd79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,9 @@ count_objects(int argc, VALUE *argv, VALUE os)
25072507
}
25082508

25092509
for (size_t i = 0; i <= T_MASK; i++) {
2510+
// type_sym can allocate an object,
2511+
// so we need to create all key symbols in advance
2512+
// not to disturb the result
25102513
types[i] = type_sym(i);
25112514
}
25122515

0 commit comments

Comments
 (0)