Christian Jullien <[email protected]> wrote:

> My allocator is much complex than that, it has start heuristics and then
> makes different mmap/munmap until it finds a location having the right
> (possibly reduced) size.
> That's why I was surprised to see munmap failed after successful mmap.

There is no possible start heuristic.  Various allocators are too likely to
use address space you don't know about.  Anything except for the NULL page,
or per-architecture limitations, is up for grabs.

So how do you know if a page is currently in use, and that you should not use 
it?

You don't.

> I'll refine my strategy or I'll fall back to -novm.

Almost all operating systems have random allocators with the same
characteristic of making MAP_FIXED a terrible idea.  And the result?
Application will fail occasionally.  That's not very nice.

Reply via email to