[fpc-devel] Improving Ref Counting

peter green plugwash at bircd.org
Wed Mar 2 22:03:42 CET 2005



> -----Original Message-----
> From: fpc-devel-bounces at lists.freepascal.org
> [mailto:fpc-devel-bounces at lists.freepascal.org]On Behalf Of DrDiettrich
> Sent: 01 March 2005 07:33
> To: FPC developers' list
> Subject: Re: [fpc-devel] Improving Ref Counting
>
>
> Jamie McCracken wrote:
>
> > A GC needs to trace an object's references to see if anything still
> > points to it. How else can it decide whether an object is no
> longer in use?
>
> GC starts from known alive object references, in static or local
> variables, and follows the references in these objects to further
> objects. Unused objects never occur in this search, so they need no
> special marking or other treatment.
> http://lists.freepascal.org/mailman/listinfo/fpc-devel

surely this also means

1: there has to be rtti for every field in every class so the compiler can
follow the paths from the class
2: you can't safely cast between classes and untyped pointers or integers
(because those refs would be invisible to the gc)
3: the GC can't work with pointers to things for every class





More information about the fpc-devel mailing list