Compiling C# with Any CPU sets Application can handle large (>2GB) addresses

前端 未结 1 864
不思量自难忘°
不思量自难忘° 2020-12-09 13:48

I ran into this issue during performance testing.

When compiling a C# Console application with the x86 platform flag, the Large Address Aware flag is not set:

1条回答
  •  轮回少年
    2020-12-09 14:07

    The purpose of AnyCPU is to be able to run managed code on both x86 and x64 platforms while at the same time take advantage of the larger address space of x64 platforms. The only way to do this is to mark the binary as large address aware when targeting AnyCPU. In addition, if this was not the case, it would have not been appropriate to make Prefer 32-bit the default.

    Where is this documented?

    This has not been explicitly documented, it's implied.

    All other stack overflow questions suggest you must do this manually

    Irrespective of all of those questions and answers, this is required only when targeting x86.

    0 讨论(0)
提交回复
热议问题