[fpc-devel] Twice stored record RTTI data

Sven Barth pascaldragon at googlemail.com
Wed Mar 2 11:10:06 CET 2016


Am 02.03.2016 08:50 schrieb "Maciej Izak" <hnb.code at gmail.com>:
>
>
> 2016-03-02 7:56 GMT+01:00 Sven Barth <pascaldragon at googlemail.com>:
>>
>> IT table is a subset that only includes managed fields while the RTTI
table also contains unmanaged ones. This way the helpers don't need to work
through larger records that only contain primitive types.
>> If that isn't the case then *that* is a bug.
>
> Arghhhh, to much Delphi :\. All confusion is related to my Delphi
knowledge. I took it as fact also for FPC.
>
> For Delphi even for XE2 in record case there is no difference between
RTTI and INIT table. RTTI table for record does not contains any
information about unmanaged fields -,- . Just pure copy of INIT table.
(Maybe in Delphi exist only INIT table in that case)
>
> Output for attached example FPC is 2, output for Delphi is 1. In Delphi
rich RTTI information about unmanaged fields for records is stored in
different place.
>
> === example ===
> type
>   TR = record
>     x: integer;
>     s: string;
>   end;
>
> begin
>   WriteLn(PTypeData(GetTypeData(typeinfo(TR)))^.ManagedFldCount);
>   readln;
> end.
>

One could say that in case of FPC the name "ManagedFldCount" isn't quite
correct ;)

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


More information about the fpc-devel mailing list