[fpc-devel] Proof of Concept ARC implementation

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Oct 29 15:45:40 CET 2014


On 29 Oct 2014, at 15:09, hinstance at yandex.ru wrote:

> With lists it's worse. If you store pointers to interface variables,  
> they become invalid the moment you don't have any "managed"  
> variables left in scope.
>
> Same is true for refcounted objects: if you store them in good old  
> TObjectList, it will hold invalid pointers.
>
> However this all is just something to keep in mind. I don't see the  
> need of overcomplicating it on compiler level
>

It's not "just something to keep in mind", because if you include  
automatic conversion from ref-counted to non-refcounted classes, this  
is guaranteed to lead to very hard to debug problems. One of Pascal's  
foundations is that it has strong type checking and does not allow you  
to assign anything to anything just because it happens to have the  
same size in bits and somewhat similar functionality. You cannot  
assign an interface to a class instance without explicitly using "as"  
either.


Jonas




More information about the fpc-devel mailing list