[fpc-devel] Suggestion: reference counted objects

Boian Mitov mitov at mitov.com
Sat Sep 20 19:33:10 CEST 2014


BTW: Rumor has it that Emb. is working to introduce Ref Counting on all 
versions of the compiler.
At the moment all of their mobile versions use it.
At the same time we have ported large portion of our code to it, and it took 
~1 month of work on and off. It is actually surprisingly easy, although our 
code always has been designed to be well structured in terms of that, and we 
have been using mostly interfaces for a decade already, so other code may be 
a different case.
As for slowing down code that may very well be offset by other design 
benefits, but that is a whole different conversation ;-) . I can easily 
prove that it may speed up your code in some cases by factor of 100, by 
allowing you easily to add hash tables or other fast search methods that 
ware more difficult to manage without the ref counting as example ;-) .

With best regards,
Boian Mitov

-------------------------------------------------------
Mitov Software
www.mitov.com
-------------------------------------------------------
-----Original Message----- 
From: Michael Van Canneyt
Sent: Saturday, September 20, 2014 5:25 AM
To: FPC developers' list
Subject: Re: [fpc-devel] Suggestion: reference counted objects



On Sat, 20 Sep 2014, Sven Barth wrote:

Secondly, there is lots of code that stores objects in lists of pointers and 
vice versa.
Checking such existing code for side effects by the sudden introduction of 
TObject
may take ages.

So reference counting TObject by default is IMHO out of the question.

I am not against a reference counted class (the idea exists since ages).
But the solution is IMHO to invent a new attribute or whatever, to allow
people to make an arbitrary class (and it's descendents) reference counted.

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel 




More information about the fpc-devel mailing list