|Copying GC and finalization email@example.com (Julian Stecklina) (2005-07-26)|
|Re: Copying GC and finalization firstname.lastname@example.org (Chris Cheney) (2005-07-28)|
|Re: Copying GC and finalization email@example.com (Florian Liekweg) (2005-07-28)|
|Re: Copying GC and finalization firstname.lastname@example.org (Julian Stecklina) (2005-08-05)|
|Re: Copying GC and finalization email@example.com (Eliot Miranda) (2005-08-21)|
|Re: Copying GC and finalization firstname.lastname@example.org (Julian Stecklina) (2005-08-24)|
|From:||Julian Stecklina <email@example.com>|
|Date:||5 Aug 2005 18:13:15 -0400|
|Posted-Date:||05 Aug 2005 18:13:15 EDT|
Chris Cheney <firstname.lastname@example.org> writes:
> Julian Stecklina <email@example.com> wrote in news:firstname.lastname@example.org:
>> I am looking for ways to implement finalization of and weak pointers
>> to objects in a copying garbage collector. I am quite puzzled on how
>> to implement this without losing the nice property of copying garbage
>> collectors that there is nothing to do for objects that have become
> Nothing to do except finalize them!
> One (naive) way is to give all objects a hidden field ('hidden' meaning that
> the garbage collector doesn't use it to find objects). I assume that the
> type of the object is determinable when the object is accessed from the
> hidden list.
> 1. When an object is created, chain it to a 'list of all current objects'
> using this field.
> 2. When an object is found and copied by the garbage collector, unchain it
> from the 'list of all current objects' and chain it to a 'temporary list'.
Without making this a doubly-linked list (and wasting another word)
this is an O(n) operation. It seems like it should be possible to
restrict this book-keeping to objects that actually have a finalizer
attached to them, thus (due to the small number of objects in need of
finalizing) the time spent modifying the list should be quite
small. Nevertheless it destroys the possibility of having a GC that
meets real-time properties.
> Now what about the weak pointers ...
In a stop-and-copy GC it should be possible to scan through all
objects containing weak-pointers after the actual collection and
replace every pointer to from-space by NIL or #f or something.
Yes, it does. Thanks.
Return to the
Search the comp.compilers archives again.