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

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

Reply via email to