如何让我的 32 位 Delphi 应用程序在 64 位窗口上使用 4gb 内存(通过 Wow64.exe)? [英] How can I enable my 32-bit Delphi application to use 4gb of memory on 64-bit windows (via Wow64.exe)?

查看:29
本文介绍了如何让我的 32 位 Delphi 应用程序在 64 位窗口上使用 4gb 内存(通过 Wow64.exe)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此 MSDN 页面:

WOW64 使 32 位应用程序能够充分利用 64 位内核.因此,32 位应用程序可以使用大量的内核句柄和窗户把手.但是,32 位应用程序可能无法创建WOW64 下的线程数和它们一样多在基于 x86 的本地运行时可以系统,因为 WOW64 分配了一个额外的 64 位堆栈(通常为 512KB) 用于每个线程.此外,一些保留的地址空间量对于 WOW64 本身和数据它使用的结构.数量保留取决于处理器;更多保留在 Intel Itanium 上而不是在 x64 处理器上.

WOW64 enables 32-bit applications to take advantage of the 64-bit kernel. Therefore, 32-bit applications can use a larger number of kernel handles and window handles. However, 32-bit applications may not be able to create as many threads under WOW64 as they can when running natively on x86-based systems because WOW64 allocates an additional 64-bit stack (usually 512 KB) for each thread. In addition, some amount of address space is reserved for WOW64 itself and the data structures it uses. The amount reserved depends on the processor; more is reserved on the Intel Itanium than on the x64 processor.

如果应用程序具有IMAGE_FILE_LARGE_ADDRESS_AWARE 标志在图像头中设置,每个 32 位应用程序接收 4 GB 的虚拟WOW64中的地址空间环境.如果IMAGE_FILE_LARGE_ADDRESS_AWARE 标志是未设置,每个 32 位应用程序接收 2 GB 的虚拟地址空间在WOW64环境中.

If the application has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag set in the image header, each 32-bit application receives 4 GB of virtual address space in the WOW64 environment. If the IMAGE_FILE_LARGE_ADDRESS_AWARE flag is not set, each 32-bit application receives 2 GB of virtual address space in the WOW64 environment.

如何在我的 Delphi 2007 应用程序中有效地设置 IMAGE_FILE_LARGE_ADDRESS_AWARE 标志,以便我可以让我的 32 位应用程序 Wow64 感知 并寻址多达 4GB 的内存?

How do I effectively set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in my Delphi 2007 application so that I can make my 32-bit application Wow64 aware and address up to a full 4GB of memory?

推荐答案

请参阅这篇 CodeCentral 文章:使用超过32 位 Delphi 程序中的 3 GB 内存.

See this CodeCentral article: Using more than 3 GB memory in a 32 bit Delphi program.

在现代 Delphi 版本中,只需将编译器指令添加到 dpr:{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}

In modern Delphi versions just add compiler directive to the dpr: {$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}

这篇关于如何让我的 32 位 Delphi 应用程序在 64 位窗口上使用 4gb 内存(通过 Wow64.exe)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆