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  -  [email protected]
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
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to