[fpc-devel] Improving Ref Counting

Marco van de Voort marcov at stack.nl
Sun Feb 27 12:52:00 CET 2005

> circular refs should also be done if applicable)
> 6) Whenever an exception is thrown, wait until its either handled or 
> fully propagated and then perform some garbage collection. (traverse the 
> single linked list of all managed objects and for each object check 
> whether anything that references it is still valid and delete if 
> appropriate).

I also thought immediately what Uberto already said: how do you recognize
a valid/invalid reference without accessing memory that is invalid in the mean

Also note that the list of references must be a dynamically size structure,
incurring getmem and size-change overhead on a simple assignment.

I doubt performance would improve, specially since the edge of this problem
(the worst 90%) can be taken off by simply disabling try...finally generation
in places where they are unlikely to happen.

More information about the fpc-devel mailing list