On Sun, Dec 28, 2014 at 07:51:25PM -0200, Marcos Douglas wrote:
> > Delphi. As a first try I remove the "const", in case of unexpected trouble.
> 
> Delphi and FPC have problems with refcounting -- but I'm referring
> only interfaces.
> Circular references is a big problem too.

This is totally new for me. I have used interfaces a lot, and while I had
trouble from time to time, I haven't really encountered these.
 
> This link could help:
> http://blog.synopse.info/post/2012/06/18/Circular-reference-and-zeroing-weak-pointers

IMHO wrong. GC also has problems, e.g. when two roots circularly reference
eachother. The major implementations are somewhat hardened against it, but
more involved reference counting implementations (like Python) are too.

Delphi/FPC reference counting is simple and cheap. The problem is IMHO not
the implementation, but the fact that people try to abuse it for things it
wasn't meant for (a holistic automatic memory management solution).

ARC is IMHO no solution but only damage control (by explicitely naming pure
references). IIRC Python has similar tricks to keep circular detections
cheap (cycle checking can stop at a weak reference)



--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to