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
2010-08-21 00:40:51
Useful, but it isn't efficient for repeated searches.
MeDiCS
2010-08-21 11:29:03