AllocationPreference注册表项是否仍适用于Windows 10 x64? [英] Does AllocationPreference Registry key still work in Windows 10 x64?

查看:82
本文介绍了AllocationPreference注册表项是否仍适用于Windows 10 x64?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试打开LARGE_ADDRESS_AWARE的32位VC ++应用程序,我想测试在地址空间中自上而下分配内存的时间。  我将注册表DWORD值AllocationPreference设置为0x100000,如MSDN中所述。  (完整
路径为HKEY_LOCAL_MACHINE / System / CurrentControlSet / Control / Session Manager / Memory Management)。  分配仍然是自下而上的。  我的C ++代码很简单:

I'm testing a 32-bit VC++ application with LARGE_ADDRESS_AWARE turned on, and I want to test when memory is allocated top-down in the address space.  I set the Registry DWORD value AllocationPreference to 0x100000 as documented in MSDN.  (Full path is HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/Session Manager/Memory Management).  Allocations still happen bottom-up.  My C++ code is trivial:

    for(int i = 0; i< 96; i ++)printf(" p =%p \ n",malloc(1024 * 1024 * 32));

   for (int i = 0; i < 96; i++) printf ("p=%p\n", malloc (1024 * 1024 * 32));

输出显示升序地址。  如果我在Windows 7 x64上运行相同的程序,同时也设置了注册表值,则分配会自上而下发生 - 降序地址。

The output shows ascending addresses.  If I run the same program on Windows 7 x64, also with the Registry value set, then allocations happen top-down - descending addresses.

Windows中是否不再支持该注册表值10?

Is that Registry value no longer supported in Windows 10?

推荐答案

嗨Doug Stauffer,你好b $ b感谢您在此发帖。

Hi Doug Stauffer,
Thank you for posting here.

我还没有找到微软的相关官方文章,说明AllocationPreference注册表项仍然在win 10中运行。

I haven't found the related official articles from Microsoft to state the AllocationPreference registry key still works in win 10.

据我所知,"AllocationPreference"用于在开发时测试应用程序兼容性,并希望从x86 dev环境将产品从x86迁移到x64

As far as I know, "AllocationPreference is used to test the application compatibility when in dev time and want migrate the product form x86 to x64

。而胜利10已经是64位版本,似乎没有必要 设置值。

from x86 dev environment. And win 10 is already on 64-bit editions, it seems to be no need to  set the value.

/ LARGEADDRESSAWARE 选项告诉链接器应用程序可以处理大于2千兆字节的地址。在64位编译器中,默认情况下启用此选项。

The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes. In the 64-bit compilers, this option is enabled by default.

该选项只是告诉应用程序可以处理大于2千兆字节的地址。它没有说存储器是在地址空间中自上而下或下至上分配的。

The option just tells that the application can handle address larger than 2 gigabytes. It doesn’t say that the memory is allocated top-down or down-top in the address space.

根据你的描述。我创建一个项目并在win10上重现您的问题(不要将注册表DWORD值AllocationPreference设置为0x100000)。

According to your description. I create a project and reproduce your issue on win10(don’t set the registry DWORD value AllocationPreference to 0x100000).

我在我的计算机上找不到注册表。

I cannot find the registry on my computer.

请告诉我们如何设置值?

Could you please tell us how to set the value?

这是我的测试结果和屏幕截图。

Here is my test result and screen shot.

最好的问候,

Hart

Best Regards,
Hart


这篇关于AllocationPreference注册表项是否仍适用于Windows 10 x64?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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