[fpc-devel] Suggestion: reference counted objects

Sven Barth pascaldragon at googlemail.com
Mon Sep 22 14:39:17 CEST 2014

Am 22.09.2014 12:59 schrieb "Hans-Peter Diettrich" <DrDiettrich1 at aol.com>:
> Sven Barth schrieb:
>> On 21.09.2014 21:09, Hans-Peter Diettrich wrote:
>>> Sven Barth schrieb:
> [...]
>>> I'd add a _RefCount field to TObject, regardless of whether it's really
>>> used later; this will fix the field offset - just like the VMT reference
>>> is fixed in TObject, but not in Object types. This will eliminate
>>> problems with class helpers.
>> I've especially written that it's not part of *every* objects, because
people complained about the size increase for all instances.
> That's why I also suggested an compiler option, useful for all people
which care about program size or ARC at all.

The problem with the compiler option is that you'd need to rebuild the
complete RTL, packages and your application so that every unit has these
changes. Otherwise e.g. the RTL would still contain reference counting code
and TObject would still contain a reference count field.

>> It. Was. Just. An. Example. To. Illustrate. The. Problem!
>> I would implement that differently as well, but there's *no* point to do
that inside an example that's supposed to be as simple as possible!
> Is it me, or what else makes you so angry today?
> Sorry for that :-(

I'm sorry that I got aggressive, but it's quite frustrating when one writes
a simple example to illustrate something and the first complain is how to
make it use a better design which is completely besides the point of the
example -.-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140922/748a0725/attachment.html>

More information about the fpc-devel mailing list