[fpc-devel] Suggestion: reference counted objects

Marco van de Voort marcov at stack.nl
Sat Sep 20 16:01:01 CEST 2014


In our previous episode, Sven Barth said:
> > Please do not reference count TObject. This is a uniquely bad and
> > unnecessary idea. I will switch to ANSI C if you guys do it
> 
> Please enlighten me why you think it is bad. Give reasons and don't be 
> like "a farmer doesn't eat what he doesn't know" (rough translation of a 
> German proverb).

Performance, size increase of minimal tobject. Both are killing for existing
light object in memory  frameworks.
 
> And just to give you a reason *for* reference counted objects: they 
> would finally allow to use operator overloads on classes, because then 
> temporarily created objects are created correctly (think about an 
> expression like "a * (b + c)" with classes).

Boring.

> Please also note that I said that I don't consider them to be the holy 
> grail especially considering that I know of some of the technial 
> problems one needs to face when implementing them in an already existing 
> language.

The point is that it shouldn't hurt, so IMHO should stay away from the base
type.  DO whatever you want for your own root object-and-down, but don't
force it upon others.




More information about the fpc-devel mailing list