[fpc-devel] Suggestion: reference counted objects

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sat Sep 27 15:42:35 CEST 2014


Florian Klämpfl schrieb:
> If the time spent in this thread had been spent in coding, FPC would have already ARC. The list has
> approx. 600 members, 200 message were written. If each of the 600 members spent on average 1 min
> reading this thread, this is 2000 man-hour, i. e. approx. 1 MY :)

First understanding the compiler code will take more time, until one 
knows where to start coding.

Second I already supplied two proposals, which could be implemented in a 
few lines:
1) Use virtual _AddRef and _Release, override for ARC classes
2) Dto. non-virtual, add _RefCount to TObject, init to -1 for no ARC
In either case the compiler inserts calls to _AddRef/_Release wherever 
it already does for interfaces.

Last not least somebody must be entitled to implement ARC, against all 
objections of the users ;-)

DoDi




More information about the fpc-devel mailing list