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?
Thanks,
Alex
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With