Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread wkitty42
On 03/02/2016 08:22 AM, Maciej Izak wrote: we should do the things in proper way. that can't be explained as "by design". while i do not understand all the deep reasonings and such, i question the "do things in the proper way" comment... who says that delphi is "doing it in the proper way"??

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 23:38 GMT+01:00 Sven Barth : > With your collection it's more that I feel uneasy with your > implementation. In general I'm in favor of the addition... But this topic > is definitely different. > > Maybe you need more help from my side? > How can you know that no one is using this? And

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Sven Barth
Am 02.03.2016 20:02 schrieb "Maciej Izak" : > > 2016-03-02 19:30 GMT+01:00 Sven Barth : >> >> I can already tell you now that this part of your code will definitely not be merged then. > > ok. no problem with that, I got used to, similar like many other Delphi compatible code - for example Generics

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 19:30 GMT+01:00 Sven Barth : > I can already tell you now that this part of your code will definitely not > be merged then. > ok. no problem with that, I got used to, similar like many other Delphi compatible code - for example Generics.Collections. ;) > It will break code that relies

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Sven Barth
Am 02.03.2016 17:49 schrieb "Maciej Izak" : > > 2016-03-02 17:15 GMT+01:00 Sven Barth : >> >> This will not be changed due to backwards compatibility. This is not up for discussion. > > > No. Real argument please and technical detail. You can argue in this way any buggy element in compiler. Any log

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 17:15 GMT+01:00 Sven Barth : > This will not be changed due to backwards compatibility. This is not up > for discussion. No. Real argument please and technical detail. You can argue in this way any buggy element in compiler. Any logical example where this bug "feature" is used? I thin

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Steve Hildebrandt
Am 02.03.2016 um 16:51 schrieb Maciej Izak: 2016-03-02 16:40 GMT+01:00 Steve Hildebrandt >: This solution would leave one unable to aquire information about non manged record fields. So in my opinion either adding seperate information for non manged

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Sven Barth
Am 02.03.2016 15:42 schrieb "Maciej Izak" : > > 2016-03-02 15:14 GMT+01:00 Michael Van Canneyt : >> >> That depends. RTTI contains all published fields, managed or not. >> as Sven pointed out, the doubling is there for efficiency reasons. > > > It can be solved more correctly and also efficiency. D

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 16:40 GMT+01:00 Steve Hildebrandt : > This solution would leave one unable to aquire information about non > manged record fields. > So in my opinion either adding seperate information for non manged fields > or a simple renaming(making it clear what information to expect) are > prefera

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Steve Hildebrandt
Am 02.03.2016 um 16:32 schrieb Maciej Izak: 2016-03-02 16:07 GMT+01:00 Jonas Maebe >: FWIW, our documentation explicitly mentions that our RTTI format is not the same as Delphi's: http://www.freepascal.org/docs-html/user/usersu87.html (7th bullet)

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 16:07 GMT+01:00 Jonas Maebe : > FWIW, our documentation explicitly mentions that our RTTI format is not > the same as Delphi's: > http://www.freepascal.org/docs-html/user/usersu87.html (7th bullet) There is also in this point: "This should not be a problem if the API of the TypeInfo u

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Jonas Maebe
Maciej Izak wrote on Wed, 02 Mar 2016: and I forgot to mention that TypeInfo(TRec) should point to init table or to identical copy of that structure in rtti table for consistent data. For second variant rtti table, may contain additionally data after standard copy of init data. FWIW, our docu

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 15:54 GMT+01:00 Maciej Izak : > 2016-03-02 15:42 GMT+01:00 Maciej Izak : > >> Delphi is storing full record RTTI data in other place without >> confusion. Init rtti is untouched. >> > > Ofc. init rtti is also untouched in FPC I mean using the same structure > for full rtti and init rtt

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 15:42 GMT+01:00 Maciej Izak : > Delphi is storing full record RTTI data in other place without confusion. > Init rtti is untouched. > Ofc. init rtti is also untouched in FPC I mean using the same structure for full rtti and init rtti as breaking thing. -- Best regards, Maciej Izak

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 15:14 GMT+01:00 Michael Van Canneyt : > That depends. RTTI contains all published fields, managed or not. > as Sven pointed out, the doubling is there for efficiency reasons. > It can be solved more correctly and also efficiency. Delphi is storing full record RTTI data in other place w

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Michael Van Canneyt
On Wed, 2 Mar 2016, Maciej Izak wrote: 2016-03-02 11:10 GMT+01:00 Sven Barth : One could say that in case of FPC the name "ManagedFldCount" isn't quite correct ;) Maybe is good idea to adjust this? Storing unmanaged fields info as managed fields in RTTI table is a little confusing... Tha

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Maciej Izak
2016-03-02 11:10 GMT+01:00 Sven Barth : > One could say that in case of FPC the name "ManagedFldCount" isn't quite > correct ;) > Maybe is good idea to adjust this? Storing unmanaged fields info as managed fields in RTTI table is a little confusing... There is no gain from storing unmanaged fields

Re: [fpc-devel] Twice stored record RTTI data

2016-03-02 Thread Sven Barth
Am 02.03.2016 08:50 schrieb "Maciej Izak" : > > > 2016-03-02 7:56 GMT+01:00 Sven Barth : >> >> 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.

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Maciej Izak
2016-03-02 7:56 GMT+01:00 Sven Barth : > 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. >

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Sven Barth
Am 02.03.2016 02:28 schrieb "Maciej Izak" : > > 2016-03-02 0:48 GMT+01:00 Maciej Izak : >> >> >> RTTI table in most of cases includes also most of INIT table data (probably full copy). >> > > sidenote: at the moment the generation of RTTI table does not make sense. INIT table is sufficient also for

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Maciej Izak
2016-03-02 0:48 GMT+01:00 Maciej Izak : > > RTTI table in most of cases includes also most of INIT table data > (probably full copy). > > sidenote: at the moment the generation of RTTI table does not make sense. INIT table is sufficient also for exploring record RTTI by TypeInfo. -- Best regards

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Maciej Izak
2016-03-02 0:16 GMT+01:00 Sven Barth : > This is by design and your patch would break existing code anyway. > > The init RTTI contains merely those fields that need initialization > (namely interfaces, strings and dynamic arrays) and which is used for the > fpc_initialize(), fpc_finalize() and fpc

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Sven Barth
Am 01.03.2016 23:44 schrieb "Maciej Izak" : > > 2016-03-01 23:20 GMT+01:00 Michael Van Canneyt : >> >> >> Please report this in the bugtracker. > > > Done, patch attached > > http://bugs.freepascal.org/view.php?id=29767 This is by design and your patch would break existing code anyway. The init R

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Maciej Izak
2016-03-01 23:20 GMT+01:00 Michael Van Canneyt : > > Please report this in the bugtracker. > Done, patch attached http://bugs.freepascal.org/view.php?id=29767 -- Best regards, Maciej Izak Index: ninl.pas === --- ninl.pas (revision

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Michael Van Canneyt
On Tue, 1 Mar 2016, Maciej Izak wrote: 2016-03-01 20:35 GMT+01:00 Maciej Izak : when "TypeInfo" is used for managed record, then RTTI data for those record is stored twice into executable file (useless). Should I report this as bug? Maybe is some reason for that behavior? Example code to gen

Re: [fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Maciej Izak
2016-03-01 20:35 GMT+01:00 Maciej Izak : > when "TypeInfo" is used for managed record, then RTTI data for those > record is stored twice into executable file (useless). Should I report this > as bug? Maybe is some reason for that behavior? Example code to generate > extra RTTI bytes: > Seems righ

[fpc-devel] Twice stored record RTTI data

2016-03-01 Thread Maciej Izak
Hi, when "TypeInfo" is used for managed record, then RTTI data for those record is stored twice into executable file (useless). Should I report this as bug? Maybe is some reason for that behavior? Example code to generate extra RTTI bytes: === uses typinfo; type TFoo = record foo: strin