[fpc-devel] Management operators AddRef and Copy vs Copy

Maciej Izak hnb.code at gmail.com
Mon Apr 11 21:31:31 CEST 2016


2016-04-10 18:53 GMT+02:00 Maciej Izak <hnb.code at gmail.com>:

>
> Important note:
> operator Initialize is called after system int_initialize for required
> record fields
> operator Finalize is called before system int_finalize for required record
> fields
> operator AddRef is called after int_addref for required fields
> operator Copy is called after fpc_Copy_internal for required fields
>

Small correction. Copy operator(if declared) is executed instead of
fpc_Copy_internal (any other behavior has no sense). To call default
fpc_Copy_internal operation is possible to call CopyArray. For example

class operator TFoo.Copy(constref aSrc: TFoo; var aDst: TFoo);
begin
  CopyArray(@aDst, @aSrc, TypeInfo(TFoo), 1);
end;

I need to fix/adjust this on branch.
-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160411/d2b7a7b4/attachment.html>


More information about the fpc-devel mailing list