mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add a comment about why we're checking the finalizer table
This commit is contained in:
parent
3c80889802
commit
f3dddd77a9
1 changed files with 5 additions and 0 deletions
5
gc.c
5
gc.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue