[fpc-devel] Pascal Smart Pointers Idea + ARC implementation
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
>> RTTI of the record so that fpc_initialize(), fpc_finalize() and
>> can pick them up. This will be needed anyway should such records be
>> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel