[fpc-devel] Pascal Smart Pointers Idea + ARC implementation

Sven Barth pascaldragon at googlemail.com
Sat Oct 10 13:23:58 CEST 2015


Am 10.10.2015 12:15 schrieb "Michael Van Canneyt" <michael at freepascal.org>:
>> Just allow those three
>> operator overloads for normal records and have them be present in the
Init
>> RTTI of the record so that fpc_initialize(), fpc_finalize() and
fpc_copy()
>> can pick them up. This will be needed anyway should such records be
placed
>> in arrays or other records or classes. (Of course from great power comes
>> great responsibility ;) )
>
>
> I don't know how this works internally.
> Is fpc_initialize called for every record type ? I sincerely hope not.

For every variant, managed type and record with init RTTI (which is the
case if the record contains a variant, a managed type or a record with init
RTTI). Same for fpc-copy and fpc_finalize. Records that contain managed
operators would simply fall under the category "record with init RTTI as
well", those that don't wouldn't have an init RTTI (at least if they don't
fullfill the criteria for it anyway ;) ).

> Does the compiler check the actual RTTI to decide whether fpc_initialize
and friends are called ?

As said above only on types that directly or indirectly need it.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20151010/af86f000/attachment.html>


More information about the fpc-devel mailing list