[fpc-devel] Proof of Concept ARC implementation

Sven Barth pascaldragon at googlemail.com
Mon Oct 27 14:20:13 CET 2014


Am 27.10.2014 11:26 schrieb "Jonas Maebe" <jonas.maebe at elis.ugent.be>:
>
>
> On 27 Oct 2014, at 11:10, Sven Barth wrote:
>
>> A third possiblity would be to implement a cycle detector in the
decrement helper, but I haven't come around that for now as I wanted to get
a first rough implementation out to you all ;)
>
>
> I think that a cycle detector should be an independent component, just
like heaptrc is an independent add-on to detect memory problems in regular
programs.

My plan was to add this as a callback. Thus way one could use a collector
in a different thread or a synchronous one :)

>
> Additionally, as mentioned before, I still believe it's a very bad idea
to be able to inherited from a regular class and turn it into a reference
counted class. Reference counted and non-reference-counted classes are
different language entities with different behaviour and different code
generation requirements, and hence should be completely unrelated.
>
> Even if you completely forbid typecasting a reference counted class into
a non-reference-counted parent class, simply calling an inherited method
from a non-reference-counted parent class can easily completely mess up the
reference counting (e.g. suppose that inherited method inserts "self" into
a linked list).

That's why I implemented it like this for now so we could check on real
code whether there would be any problems instead of theorizing about it. :)
Afterall I said it's experimental and nowhere near final.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20141027/34cb6ae7/attachment.html>


More information about the fpc-devel mailing list