Re: mmap(MAP_FIXED) vs mprotect

2013-04-25 Thread Ryan Johnson
On 24/04/2013 8:50 AM, Corinna Vinschen wrote: On Apr 24 08:03, Ryan Johnson wrote: Hi all, I'm trying to port a linux program that uses mmap to implement a growable array; the ideas is to mmap(PROT_NONE, MAP_NORESERVE) a chunk of address space (corresponding to the maximum array size) and

mmap(MAP_FIXED) vs mprotect

2013-04-24 Thread Ryan Johnson
Hi all, I'm trying to port a linux program that uses mmap to implement a growable array; the ideas is to mmap(PROT_NONE, MAP_NORESERVE) a chunk of address space (corresponding to the maximum array size) and then call mmap(PROT_READ|PROT_WRITE, MAP_FIXED) to allocate actual memory in the

Re: mmap(MAP_FIXED) vs mprotect

2013-04-24 Thread Corinna Vinschen
On Apr 24 08:03, Ryan Johnson wrote: Hi all, I'm trying to port a linux program that uses mmap to implement a growable array; the ideas is to mmap(PROT_NONE, MAP_NORESERVE) a chunk of address space (corresponding to the maximum array size) and then call mmap(PROT_READ|PROT_WRITE, MAP_FIXED)