3 ms·
No, I want, in my address space, to say to the kernel "when you decide what bit of my memory map to return from mmap and friends, don't use these addresses.". T
by CJefferson 8y ago
No, I want, in my address space, to say to the kernel "when you decide what bit of my memory map to return from mmap and friends, don't use these addresses.". That shouldn't cost anything, except storing the blocks I want reserving.
This is surprisingly hard to do in user space. You can tell mmap where to put allocations, but not where not to put them. Also it's hard to control what your Libc's malloc will do.
- klodolph 8y agoYou can do this with mmap(). Just use PROT_NONE, you'll get a mapping but you can't read, write, or execute it. Sure, it will show up in the "virtual memory" usage of your process. That's just how the virtual memory accounting works.