[fpc-devel] InterLockedExchange vs InterLockedExchange64 using pointers on cpu64

Jeppe Johansen jepjoh2 at es.aau.dk
Thu Nov 4 10:43:35 CET 2010


Den 03-11-2010 20:02, Andrew Brunner skrev:
> On a 64bit fpc compile, and 64bit system with pointers, which
> interlocked exchange is best used?  Aren't pointers on x64 64bit
> pointers?  Shouldn't we be using InterlockedExhange64 code to access
> specific x64 swaps?
>
> Thanks.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
function InterLockedExchange (var Target: Pointer;Source : Pointer) : 
Pointer;

always maps directly to InterLockedExchange64 on 64bit and 
InterLockedExchange on 32bit. See line 988 and 994 in systemh.inc

So you're fine using InterlockedExchange on pointers. The other version 
with longint is always 32bit no matter the platform



More information about the fpc-devel mailing list