Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 08:00, Martin Schreiber wrote: On Saturday 14 July 2012 07:50:58 Martin Schreiber wrote: On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: I've implemented an optimization that reorders the instance fields of Delphi-style classes (and only of Delphi-style classes) to

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Michael Van Canneyt
On Sat, 14 Jul 2012, Jonas Maebe wrote: On 14 Jul 2012, at 08:00, Martin Schreiber wrote: On Saturday 14 July 2012 07:50:58 Martin Schreiber wrote: On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: I've implemented an optimization that reorders the instance fields of Delphi-style

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Martin Schreiber
On Saturday 14 July 2012 14:26:32 Michael Van Canneyt wrote: If would you want to use that optimization, then yes. Working around the type system of the language is however generally asking for trouble, regardless of what reason you do it for. Indeed. Maybe we can help by making some

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Martin Schreiber
On Saturday 14 July 2012 14:07:30 Jonas Maebe wrote: Hmm, up to now I listed in the cracker classes fields up to the last private field I need to access so the cracker classes would not brake by changing or adding successive fields in the original classes. I assume now it is necessary to

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Sven Barth
Am 14.07.2012 07:45 schrieb Martin Schreiber mse00...@gmail.com: On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: Hi, I've implemented an optimization that reorders the instance fields of Delphi-style classes (and only of Delphi-style classes) to minimise memory gaps caused by

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Florian Klämpfl
Am 14.07.2012 01:44, schrieb Jonas Maebe: Hi, I've implemented an optimization that reorders the instance fields of Delphi-style classes (and only of Delphi-style classes) to minimise memory gaps caused by alignment differences and odd sizes. The effect is the same as when you would

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Nico Erfurth
On 14.07.12 01:44, Jonas Maebe wrote: I've implemented an optimization that reorders the instance fields of Delphi-style classes (and only of Delphi-style classes) to minimise memory gaps caused by alignment differences and odd sizes. The effect is the same as when you would change the order

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 18:02, Martin Schreiber wrote: I do not necessarily want to use field order optimization but if the FPC RTL is compiled with it I need to compile my cracker classes with optimization too. That's indeed true. Jonas___

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 20:29, Nico Erfurth wrote: So basically, something like class MyClass = class {$OPTIMIZATION OFF} private FHeavilyUsedValue: Boolean; FAlsoHeavilyUsedValue: DWord; {$OPTIMIZATION DEFAULT} NotOftenUsed: Byte; end; should leave the ordering of the first

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 20:52, Jonas Maebe wrote: On 14 Jul 2012, at 18:02, Martin Schreiber wrote: I do not necessarily want to use field order optimization but if the FPC RTL is compiled with it I need to compile my cracker classes with optimization too. That's indeed true. That may

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Sven Barth
Am 14.07.2012 21:48 schrieb Jonas Maebe jonas.ma...@elis.ugent.be: I guess there are probably no such FPC-compiled programs yet (*), so maybe now is the time to add that before we also get stuck with that particular piece of ballast. Somehow I have the feeling that we all know what one of your