diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-09 07:51:16 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-09 07:51:16 -0700 |
commit | d682e4e1b074ffa4315b67a56109ef648931883c (patch) | |
tree | c582a6927b479cba581966330ffbfe19b71f7c4f /syslog.h | |
parent | aaef40301fcb91506898678c39cb62dc6fe0a285 (diff) | |
download | txr-d682e4e1b074ffa4315b67a56109ef648931883c.tar.gz txr-d682e4e1b074ffa4315b67a56109ef648931883c.tar.bz2 txr-d682e4e1b074ffa4315b67a56109ef648931883c.zip |
Finalization fix: incorrect for generational gc.
Another bug found in the finalization hooks. The reachability
test being applied is not correct for generational GC,
relying only on the REACHABLE flag. This bug means that we
call finalization hooks on mature objects, while they remain
reachable. It must use the gc_is_reachable logic, just like
weak hash table processing does, because under an incremental
garbage collection pass, all gen 1 objects are considered
reachable (though they don't have the REACHABLE flag set).
* gc.c (struct fin_reg): Remving obj_type member, replacing
with reachable flag.
(is_reachable): New static function based on gc_is_reachable,
minus the is_ptr test. (GC code which knows it is dealing with
a pointer doesn't need the test).
(prepare_finals): In the first pass, instead of memorizing the
prior object type, simply calculate the reachable flag,
correctly taking into account generational GC.
(call_finals): Rely on the new reachable flag rather than
the REACHABLE flag in the saved obj_type.
(gc_is_reachable): Becomes a public wrapper for is_reachable
which adds the pointer test.
(gc_finalize): Initialize the reachable member of fin_reg.
Remove initialization for obj_type.
Diffstat (limited to 'syslog.h')
0 files changed, 0 insertions, 0 deletions