[fpc-devel] Proof of Concept ARC implementation

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Oct 31 04:54:12 CET 2014


Sven Barth schrieb:
> On 30.10.2014 04:14, Hans-Peter Diettrich wrote:

>> I wonder how difficult it would be to implement the existing Interface
>> refcounting model for TObject, so that this runtime variation could be
>> tested and benchmarked as well, in addition to the current compiletime
>> approach. According to the problems of the compiletime approach,
>> revealed in this thread, it looks not viable to me at all.
> 
> The code would mostly be the same as the one I already implemented. Add 
> "virtual" to the ARCDecRef, ARCIncRef and ARCRefCount methods of 
> TObject, adjust the RTL helper functions to not expect a refcount field 
> at a specific offset, remove the restrictions that reference counting is 
> only done for classes marked as "refcounted" and you're done...

Looks quite easy :-)

Could you introduce this feature into your branch, by conditional 
compilation?


Mark just pointed me to another problem, possibly unhandled yet. 
Interface refcounting must be updated, as soon as the underlying object 
becomes refcounted as well. Do you already have an idea how to handle 
refcounting for classes with interfaces?

DoDi




More information about the fpc-devel mailing list