Am 28.08.2012 12:13, schrieb Michael Schnell:
>>> Ok, but if there are reef-counted objects what is the point in not >>> using them ?
>>
>> I would not use them, because of my experiences with the garbage
>> collector of .NET. After using it, I know that I should decide when a
>> object has to be destroyed.
>>
>
> I don't understand. While the visible effect is the same (no Free any
> more), I understand that the concept of  garbage collecting ("at
> certain times, take a look what is not used any more") and fpc's
> reference counting (delete unused stuff at once when it is clear that
> nobody uses it any more) is completely different.

Reference counting is one type of garbage collecting. And every type causes overhead and problems.

> I understand that the reference counting works perfectly with strings,
> so I don't see why it should not work with Objects (even if additional
> issues might need to be taken into account and it might be appropriate
> to allow for not reference counted objects, optionally).

But how to know, if a reference is unused? Have a look at:
http://en.wikipedia.org/wiki/Reference_counting#Dealing_with_reference_cycles

It is not a problem that is caused every time. But I prefer objects which I destroy by myself, not by some magic.

Michael

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to