Closed 64teubs closed 6 years ago
Obviously, casting a 64 bit memory address to a cardinal here (which is a 32 bit unsigned integer) looses the upper 32 bits, which when set to anything else but zero means the wrong address is used. It's better to cast to UIntPtr instead (or if that's not in scope, NativeUInt).
Fixed. Thanks!
Hello,
Hunting memory leaks in my application in full debug mode in 64 bits, I have an access violation when LogStackTrace is called from the DLL. Reading the code, I suspect the following line from generating this error:
GetLocationInfo(Pointer(Cardinal(LAddress) - 1), LInfo);
Changing it toGetLocationInfo(Pointer(LAddress - 1), LInfo);
fixes the access violation, but maybe there is more to it.