[fpc-devel] Proof of Concept ARC implementation

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Oct 27 21:00:18 CET 2014


Sven Barth schrieb:
> Am 27.10.2014 17:20 schrieb "Hans-Peter Diettrich" <DrDiettrich1 at aol.com 
> <mailto:DrDiettrich1 at aol.com>>:

>  > Something like ShortString and AnsiString?
> 
> With the difference that Short- and AnsiString are assignable to 
> eachother while Jonas does not want that for reference counted and 
> ordinary classes.

Where would this matter? When TObject and TManagedObject are different 
(base) types, a direct assignment of references is impossible.


> What do you mean with "virtual counting methods"?

Overriding these methods can enable/disable refcounting for a class, and 
all classes derived from it. The default then can be to do nothing (no 
counting).

> The main reason I decided not to introduce reference counting for every 
> class was that some people feared the performance impact of the 
> reference counting. Though Florian said that it shouldn't be that bad on 
> today's CPUs...

Did you ever benchmark your model?

> That said: if someone wants to test it one could add "refcounted" to 
> TObject (my code should(!) handle that correctly) and see what 
> happens... (of course there will be problems with circular references then)

Fine :-)

DoDi




More information about the fpc-devel mailing list