Re: [fpc-pascal] How to crosscompile i386-linux from X86_64-win64

2016-03-30 Thread Sven Barth
Am 30.03.2016 10:39 schrieb "ulrich" : > > Dne 29.3.2016 v 12:19 Sven Barth napsal(a): >> >> Am 29.03.2016 10:30 schrieb "Jonas Maebe" >> > >: >> >> > >> > On 29/03/16 09:58, ulrich wrote: >> >> >> >> what

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Marco van de Voort
In our previous episode, Dmitry Boyarintsev said: > > So I definitely see the benefit in using (U)Int style data types. > > They are a lot more obvious [to the programmer] regarding data ranges > > and byte size. > > > > Does, it also make the code less high-level? > Didn't high level use the

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Dmitry Boyarintsev
On Wed, Mar 30, 2016 at 4:37 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > In my case I'm specifically referring to the benefit of using (U)Int > style data types for use in record structures when reading binary data > files. > Makes sense. > Does FPC follow that platform

Re: [fpc-pascal] heaptrc and high RAM usage

2016-03-30 Thread Andreas Schneider
Am 2016-03-30 13:35, schrieb Felipe Monteiro de Carvalho: Any ideas if I should try something else instead of heaptrc? Or any other ideas about what to do? I think valgrind could be of more use in this case, since it has specific tools for profiling (not just error/leak detection):

[fpc-pascal] heaptrc and high RAM usage

2016-03-30 Thread Felipe Monteiro de Carvalho
Hello, I have an app that is using too much RAM and I am trying to figure out which structures are using how much RAM. Note that this is not a leak, everything is freed nicely when the app closes, so I am resorting to putting DumpHeap() calls somewhere. The app has multiple threads and is fairly

Re: [fpc-pascal] IFDEF usage in x86_64's SwapEndian() implementation

2016-03-30 Thread Michael Van Canneyt
On Wed, 30 Mar 2016, Graeme Geldenhuys wrote: On 2016-03-30 11:58, Michael Van Canneyt wrote: The code is there to differentiate between the windows ABI and other ABIS, which specify in what register the AValue parameter is passed. Ah okay. One could possibly write it in a less ambiguous

Re: [fpc-pascal] IFDEF usage in x86_64's SwapEndian() implementation

2016-03-30 Thread Graeme Geldenhuys
On 2016-03-30 11:58, Michael Van Canneyt wrote: > The code is there to differentiate between the windows ABI and other ABIS, > which specify in what register the AValue parameter is passed. Ah okay. One could possibly write it in a less ambiguous way, as follows? No IFDEF's needed. function

Re: [fpc-pascal] IFDEF usage in x86_64's SwapEndian() implementation

2016-03-30 Thread Graeme Geldenhuys
On 2016-03-30 11:09, Bart wrote: > So this code distincts between 64-bit Windows and 64-bit "any other OS" Say for example I have two identical Intel i7 based systems. One with 64-bit FreeBSD installed, and one with 64-bit Win7. What you are saying is that SwapEndian() will execute different code

Re: [fpc-pascal] IFDEF usage in x86_64's SwapEndian() implementation

2016-03-30 Thread Bart
On 3/30/16, Graeme Geldenhuys wrote: > Surely the usage of IFDEF WIN64 is not 100% correct or accurate. Should > the above not rather read IFDEF CPU64? Me thinks: It's in ($pfcsource)rtl\x86_64\x86_64.inc, so CPU64 will be defined in that procedure always. So this

[fpc-pascal] IFDEF usage in x86_64's SwapEndian() implementation

2016-03-30 Thread Graeme Geldenhuys
Hi, Here is the x86_64's SwapEndian() function implementation. =[ src/rtl/x86_64/x86_64.inc ] function SwapEndian(const AValue: DWord): DWord; assembler; nostackframe; asm {$ifdef win64} movl %ecx, %eax {$else win64} movl %edi, %eax {$endif win64} bswap %eax

Re: [fpc-pascal] How to crosscompile i386-linux from X86_64-win64

2016-03-30 Thread ulrich
Dne 29.3.2016 v 12:19 Sven Barth napsal(a): Am 29.03.2016 10:30 schrieb "Jonas Maebe" >: > > On 29/03/16 09:58, ulrich wrote: >> >> what parameter(s) need to cross-compiling i386-Linux from X86_64-win64 ? > > > It is not

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Graeme Geldenhuys
On 2016-03-30 02:24, Dmitry Boyarintsev wrote: > > Does, it also make the code less high-level? In my case I'm specifically referring to the benefit of using (U)Int style data types for use in record structures when reading binary data files. In this case, no matter the platform, the data

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Mark Morgan Lloyd
Marco van de Voort wrote: Moreover since shorter types are not always faster, I think it is better to forget all this, and in new code use INTEGER for the variable types, where range doesn't matter (much) and (u)int for the rest. Seems eminently sensible to me. -- Mark Morgan Lloyd markMLl

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Martin Schreiber
On Tuesday 29 March 2016 21:54:22 Graeme Geldenhuys wrote: > > > I'm inclined to use the (U)IntX (with X being a element of [8, > > 16, 32, 64]) types to avoid any confusion and surprises. > > That's not a bad idea either... I'll look into that for future code. > In MSElang the base types in unit

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Florian Klaempfl
Am 30.03.2016 um 03:06 schrieb Graeme Geldenhuys: > Thanks Marco, interesting history lesson. ;-) > > On 2016-03-29 22:16, Marco van de Voort wrote: >> Moreover since shorter types are not always faster, I think it is better to >> forget all this, and in new code use INTEGER for the variable