[fpc-devel] Proof of Concept ARC implementation
Sven Barth
pascaldragon at googlemail.com
Wed Oct 29 16:38:34 CET 2014
On 29.10.2014 16:17, hinstance at yandex.ru wrote:
> I suggest leaving TList from FPC RTL as is. It works with pointers, so leave it be.
>
> For refcounted objects we would use generic list like TFPGList from fgl unit. However, currently existing TFPGList implementation would be unable to deal with refcounted objects correctly because TFPGLists uses TFPSList (u can examine source file if interested), and TFPSList moves items like memory blocks. So TFPGList can not store refcounted objects just like it can not store interface vars.
>
> A generic class capable of storing interfaces and refc-objects correctly will need to use dynamic arrays under the hood because with dynamic arrays you don't loose type information
You are wrong. TFPGList works correctly with reference counted types,
because it overrides the necessary functions of TFPSList (mainly
CopyItem). Afterall TFPGList<AnsiString> works without problems ;)
Regards,
Sven
More information about the fpc-devel
mailing list