diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2020-09-22 09:19:42 -0700 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2020-09-22 09:20:04 -0700 |
commit | f3dddd77a925f576acb6abab9b37e8839f028412 (patch) | |
tree | 0a763dec4581a7e9cc2a027fe58d5ea4a055b6a3 /gc.c | |
parent | 3c808898021009f971b94dae433d74e205175cca (diff) |
Add a comment about why we're checking the finalizer table
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -7861,6 +7861,11 @@ gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj) case T_NODE: case T_CLASS: if (FL_TEST(obj, FL_FINALIZE)) { + /* The finalizer table is a numtable. It looks up objects by address. + * We can't mark the keys in the finalizer table because that would + * prevent the objects from being collected. This check prevents + * objects that are keys in the finalizer table from being moved + * without directly pinning them. */ if (st_is_member(finalizer_table, obj)) { return FALSE; } |