在OS X后备内存 [英] Reserve memory on OS X

查看:164
本文介绍了在OS X后备内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是等同于Windows的虚拟在OS X?也就是说,我怎么能保留一个连续的地址空间,而无需实际commiting它,然后再提交它的块?

What's the equivalent to Windows's VirtualAlloc in OS X? That is, how can i reserve a contiguous address space without actually commiting it and then commit chunks of it later?

谢谢,

亚历

推荐答案

的<一个href=\"http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man2/mmap.2.html\"><$c$c>mmap()函数,调用 MAP_ANON | MAP_PRIVATE ,很大致相当于虚拟() MEM_RESERVE 标记。内存然后通过在映射触及每个页面提交。

The mmap() function, called with MAP_ANON | MAP_PRIVATE, is very roughly equivalent to VirtualAlloc() with the MEM_RESERVE flag. Memory is then committed by touching each page in the mapping.

这篇关于在OS X后备内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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