ruby-changes:63042
From: Aaron <ko1@a...>
Date: Wed, 23 Sep 2020 01:20:23 +0900 (JST)
Subject: [ruby-changes:63042] f3dddd77a9 (master): Add a comment about why we're checking the finalizer table
https://git.ruby-lang.org/ruby.git/commit/?id=f3dddd77a9 From f3dddd77a925f576acb6abab9b37e8839f028412 Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Tue, 22 Sep 2020 09:19:42 -0700 Subject: Add a comment about why we're checking the finalizer table diff --git a/gc.c b/gc.c index 5e84f51..d9c8731 100644 --- a/gc.c +++ b/gc.c @@ -7861,6 +7861,11 @@ gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L7861 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; } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/