[fpc-devel] Re: systemh.inc InterLockedIncrement64 (var Target: int64)

Andrew Brunner andrew.t.brunner at gmail.com
Wed Oct 27 16:19:53 CEST 2010


I have a 64bit cpu here running 32bit Windows 7.  I was compiling my
project under Windows 7 to do some debugging when I came across the
problem when trying to lock increment int64 variables for transactions
and bytecounts (general counter purposes).

I modified the systemh.inc that maps Increment(int64)/Decrement(int64)
etc. to map to "external" cooresponding 64 procedures.

I had tried overloading in the i386.inc unit but the compiler said it
found matching parameter functions and those changes didn't take.
I've compiled FPC.

Compiling my app I realize that there is no overloaded
InterlockedIncrement(int64) for cpu64.  Which means presently I have
to use {ifdef cpu64} {$else} {$endif} everywhere in my code. This is
not pleasant. There should be one call to all the interlocked
features.

Ok if I change?  I think having two calls per Increment*64 and
Increment*.  If I'm compiling for cpu64 then use the 64 bit routines
otherwise just use the other ones.  And in the rare occatsion that I
need Int64 on i386 just assume that I'll have the actual ability in
the CPU to access assembler features presently coded.

Objections?  Why?



More information about the fpc-devel mailing list