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.
VirtualAllocdoes. For contiguous allocation usemmap.mmapused for contiguous allocation on OS X and other Unices. Could a specialist point out the differences, if any, with Windows'VirtualAlloc? Perhaps someone who has answered that they weren't the same? (Note: the users ofmmapI was referring to went back tomallocbut I can't remember the reason)