您可以在 XP 上调整 C 运行时堆段保留大小吗?
当 XP 上的 VC6 C 运行时无法在现有堆段内满足分配请求时,它会保留一个新段。这些新段的大小增加了 2 倍(直到没有足够大的可用区域来执行此操作,此时它会下降到较小的段。)
无论如何,有什么方法可以在 XP 上控制此行为VC6运行时?例如,增加一倍,但上限为 64MB 段。
如果 XP 上没有办法,但 7 上有,那也很好知道。或者如果在 VC6 上没有办法,但在 VC8 或更高版本上有办法,那就有趣了。
When the VC6 C runtime on XP can't serve an allocation request within an existing heap segment, it reserves a new segment. The size of these new segments increase by factors of 2 (until there are not large enough free areas to do that, at which point it falls down to smaller segments.)
In any case, is there any way to control this behavior on XP with the VC6 runtime? For example, doubling up to a point, but capping at 64MB segments.
If there is no way on XP but there is on 7, that would be good to know too. Or if there is no way on VC6 but there is on VC8 or up would be interesting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要特定的分配行为,请编写您自己的分配器。 VirtualAlloc 等可以帮助你做到这一点。使用仍然受支持的编译器和 CRT 也会有所帮助。
If you want specific allocation behaviour, write your own allocator. VirtualAlloc etc are there to help you do it. Using a compiler and CRT which is still in support would help too.