Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-15 Thread Sven Barth
Am 15.12.2016 09:53 schrieb "Maciej Izak" : > > > 2016-12-14 20:06 GMT+01:00 Sven Barth : >> >> I found the "problem": write_rtti_ref() will always write an indirect >> reference (which is by design), so I adjusted the code that it will >> really write a direct one. Bye, bye, one level of indirecti

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-15 Thread Maciej Izak
2016-12-14 20:06 GMT+01:00 Sven Barth : > I found the "problem": write_rtti_ref() will always write an indirect > reference (which is by design), so I adjusted the code that it will > really write a direct one. Bye, bye, one level of indirection ;) > ^_^ but... I found another problem. We have s

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-14 Thread Sven Barth
On 14.12.2016 13:09, Maciej Izak wrote: > > 2016-12-14 11:17 GMT+01:00 Sven Barth >: > > It should be a Pointer of course, not a PPointer... I will correct > that later on (I shouldn't commit code that late -.- ). > > So I will wait again ^^ I found

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-14 Thread Sven Barth
Am 14.12.2016 13:09 schrieb "Maciej Izak" : > > > 2016-12-14 11:17 GMT+01:00 Sven Barth : >> >> It should be a Pointer of course, not a PPointer... I will correct that later on (I shouldn't commit code that late -.- ). > > So I will wait again ^^ Oh and should you manage to reproduce the problem y

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-14 Thread Maciej Izak
2016-12-14 11:17 GMT+01:00 Sven Barth : > It should be a Pointer of course, not a PPointer... I will correct that > later on (I shouldn't commit code that late -.- ). > > So I will wait again ^^ > PPU version is only increased if the structure of the PPU file is changed. > That RTTI change has no

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-14 Thread Sven Barth
Am 14.12.2016 10:00 schrieb "Maciej Izak" : > > 2016-12-14 0:16 GMT+01:00 Sven Barth : >> >> At least the patch as is (with PPointer) didn't trigger anything on Win64... > > Will it stay as PPointer (PPRecInitTable)? I am wondering why we have bug (or expected behavior?) for this. It should be a

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-14 Thread Maciej Izak
2016-12-14 0:16 GMT+01:00 Sven Barth : > At least the patch as is (with PPointer) didn't trigger anything on > Win64... > > Will it stay as PPointer (PPRecInitTable)? I am wondering why we have bug (or expected behavior?) for this. > Committed with a few adjustments. Now I only need to update Us

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-13 Thread Sven Barth
Am 13.12.2016 14:43 schrieb "Maciej Izak" : > > > 2016-12-13 14:31 GMT+01:00 Sven Barth : >> >> No idea. But I have a couple of platforms to test this on myself :) (x86_64-win64, i386-win32, powerpc-darwin, i386-linux, x86_64-linux, arm-linux, m68k-linux > > It is easy to reproduce with PRecInitTab

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-13 Thread Maciej Izak
2016-12-13 14:31 GMT+01:00 Sven Barth : > No idea. But I have a couple of platforms to test this on myself :) > (x86_64-win64, i386-win32, powerpc-darwin, i386-linux, x86_64-linux, > arm-linux, m68k-linux > It is easy to reproduce with PRecInitTable. You can play with "*PART 2* patch" with PRecIni

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-13 Thread Sven Barth
Am 13.12.2016 11:34 schrieb "Maciej Izak" : >> Okay, I think we can indeed go with this aside from one small remark: the double indirection for Pointers is only needed if data resides in different units as those might be in different dynamic packages. Since the INIT and FULL RTTI of a record are al

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-13 Thread Maciej Izak
2016-12-13 11:09 GMT+01:00 Sven Barth : > Comment regarding your previous mail: right, I forgot that due to > InitializeArray() and FinalizeArray() being publicly available version of > the internal helpers we either need to keep INIT and FULL RTTI in sync or a > way to differentiate them... That'

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-13 Thread Sven Barth
Am 13.12.2016 09:22 schrieb "Maciej Izak" : > > > 2016-12-12 23:14 GMT+01:00 Maciej Izak : >> >> With second iteration we could add your modifications, I have no other objections. > Comment regarding your previous mail: right, I forgot that due to InitializeArray() and FinalizeArray() being public

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-13 Thread Maciej Izak
2016-12-12 23:14 GMT+01:00 Maciej Izak : > With second iteration we could add your modifications, I have no other > objections. New day new ideas :) With my patch we don't really need ManagedFieldCount, ManagedFields, ManagedFieldTable in TTypeData (each of Managed* can still be added later). I

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-12 Thread Maciej Izak
2016-12-12 20:41 GMT+01:00 Sven Barth : > So, my own idea for this. First insight looks good (kudos for union with "deprecated field" ^^) and we don't have redundant info, but sorry it can't work in presented form. With your changes INIT RTTI is incompatible with RTTI, which is critical defect

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-12 Thread Sven Barth
On 09.12.2016 22:57, Maciej Izak wrote: > Hi, > > thanks Sven, finally we have initial RTTI.pas version on trunk. Let me > start with first serious issue and eventually patch: > > function IsManaged(TypeInfo: PTypeInfo): boolean; > > IsManaged can't work with records because we need know managed

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-12 Thread Maciej Izak
2016-12-12 15:53 GMT+01:00 Maciej Izak : > Field: TManagedField; // :\ a little redundant info (we have this info > also in TotalFields, but we need to deal with $RTTI EXPLICIT) To save memory I think we can use FieldIndex: Integer (instead of Field: TManagedField). FieldIndex is index to To

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-12 Thread Maciej Izak
2016-12-12 13:32 GMT+01:00 Maciej Izak : > Status of #31102 is unclear. I need clear response about ManagedFldCount > to decide how to do it - as part of FPC or NewPascal or some mixed way to > keep compatibility as much as possible (in NewPascal for sure I will > correct ManagedFldCount, current

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-12 Thread Maciej Izak
2016-12-12 13:07 GMT+01:00 silvioprog : > Could you do that please? :-) Status of #31102 is unclear. I need clear response about ManagedFldCount to decide how to do it - as part of FPC or NewPascal or some mixed way to keep compatibility as much as possible (in NewPascal for sure I will correct

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-12 Thread silvioprog
On Mon, Dec 12, 2016 at 4:52 AM, Maciej Izak wrote: > > 2016-12-11 13:18 GMT+01:00 Maciej Izak : > >> http://bugs.freepascal.org/view.php?id=31102 > > > I can provide proper patch for #31102 and for #31108 (for fields part). > Could you do that please? :-) > TotalFieldCount seems redundant (fi

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-11 Thread Maciej Izak
2016-12-11 13:18 GMT+01:00 Maciej Izak : > http://bugs.freepascal.org/view.php?id=31102 I can provide proper patch for #31102 and for #31108 (for fields part). TotalFieldCount seems redundant (finally we have in conception RecFldCnt), we could point deprecated ManagedFldCount property to RecFld

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-11 Thread Maciej Izak
2016-12-10 0:54 GMT+01:00 Sven Barth : > We rename ManagedFldCount to TotalFieldCount, add a field > ManagedFieldCount and a property ManagedFldCount that returns > TotalFieldCount for backwards compatibility (and maybe marked as > deprecated). > I've created new bug report to express my strong s

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-10 Thread Maciej Izak
10.12.2016 00:54 "Sven Barth": We rename ManagedFldCount to TotalFieldCount, add a field ManagedFieldCount and a property ManagedFldCount that returns TotalFieldCount for backwards compatibility (and maybe marked as deprecated). Looks almost like point 4. We need also to adjust ManagedFields. M

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-09 Thread Sven Barth
On 09.12.2016 22:57, Maciej Izak wrote: > Hi, > > thanks Sven, finally we have initial RTTI.pas version on trunk. Let me > start with first serious issue and eventually patch: > > function IsManaged(TypeInfo: PTypeInfo): boolean; > > IsManaged can't work with records because we need know managed

Re: [fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-09 Thread Maciej Izak
5. Super slowly checking for each field in ManagedFields, and eventually new checking for each record in ManagedFields... I am so sad that I need to post this point :\ -- Best regards, Maciej Izak ___ fpc-devel maillist - fpc-devel@lists.freepascal.or

[fpc-devel] RTTI module and "IsManaged" critical problem

2016-12-09 Thread Maciej Izak
Hi, thanks Sven, finally we have initial RTTI.pas version on trunk. Let me start with first serious issue and eventually patch: function IsManaged(TypeInfo: PTypeInfo): boolean; IsManaged can't work with records because we need know managed fields count (in Delphi when ManagedFldCount is bigger