views:

19

answers:

1

As the title says, how can I find a free block to be allocated at the highest virtual address using only the POSIX API?

+1  A: 

I would perform a binary search: using mmap with MAP_FIXED, verify whether a page can be mapped. Before testing a page, try msync to check whether the page is currently mapped already.

Martin v. Löwis
Useful, but it isn't efficient for repeated searches.
MeDiCS