What to do to make application Large Address Aware?

后端 未结 1 1545
有刺的猬
有刺的猬 2020-12-14 10:09

I am currently in process of making our application Large Address Aware. As experience has shown, there are some unexpected gotchas when doing so. I create this post to make

相关标签:
1条回答
  • 2020-12-14 10:23
    • (obvious) select Support Address Larger than 2 Gigabytes (/LARGEADDRESSAWARE) in the project properties: Linker / System / Enable Large Address
    • check all pointer subtractions and verify the result is stored in a type which can contain the possible difference, or replace them with comparisons or other constructs - see Detect pointer arithmetics because of LARGEADDRESSAWARE). Note: pointer comparison should be fine, contrary to AMD advice, there is no reason why it should cause 4 GB issues
    • make sure you are not assuming pointers have Bit31 zero, do not attempt to use Bit31 for something else.
    • replace all GetCursorPos calls with GetCursorInfo - see GetCursorPos fails with large addresses
    • for all assignments into PVOID64 use PtrToPtr64, needed e.g. when using ReadFileScatter, see ReadFileScatter remark section
    0 讨论(0)
提交回复
热议问题