[fpc-devel] Proof of Concept ARC implementation

Sven Barth pascaldragon at googlemail.com
Thu Oct 30 10:23:48 CET 2014


On 30.10.2014 04:16, Hans-Peter Diettrich wrote:
> Sven Barth schrieb:
>> On 28.10.2014 10:19, Michael Schnell wrote:
>>> On 10/27/2014 07:59 PM, Sven Barth wrote:
>>>>
>>>> - in code that does not use ARC ("modeswitch arc off" - the default;
>>>> or maybe better a local directive) all instance variables are
>>>> considered "weak"
>>>>
>>> While I do have a vision what "weak" means here, can you give an exact
>>> description ?
>>
>> - no change in reference count when assigning a refcounted object
>> variable to it
>
>> - no change in reference count when assigning it to a refcounted
>> object variable
> I suspect that this can cause premature destruction of the object, when
> either
> - another value is assigned to the refcounted object variable
> - all other (counted) references to the object disappear
>
> But I don't have a solution for these problems, as long as the compiler
> inlines the refcounting code at compile time.

Yes, weak reference fall into the category of "from great power comes 
great responsibility".

Regards,
Sven




More information about the fpc-devel mailing list