[fpc-devel] Boehm garbage collector for freepascal

Thaddy thaddy at thaddy.com
Mon Nov 15 15:22:05 CET 2010

On 15-11-2010 14:59, Michael Van Canneyt wrote:
> You must finalize, because ref. counting of interfaces etc. need to be 
> taken
> care of. Interfaces may live outside the FPC memory space, and are 
> therefor
> not accessible to the GC. If you want to let the GC collector handle all
> that, you're in essence copying what the the destructor does, and that
> seems like a wrong approach.
> Michael.
Indeed. Therefore I want to adapt the rtl at the earliest point possible 
where a pointer to object is available to mark for finalization.
It seems this is in Tobject.InitInstance. But afaik this will work with 
the code provided. See example.
For AnsiStrings it seems sufficient to take into account the extra 
ptrint that registers the size of an entity.

More information about the fpc-devel mailing list