do_mmap(): fix calculation of search_free_space() hint

This commit is contained in:
Balazs Gerofi
2017-08-01 16:24:07 +09:00
parent 831a0637a1
commit 9194742de8

View File

@ -1259,9 +1259,8 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
}
else {
/* choose mapping address */
error = search_free_space(len, region->map_end +
(fd > 0) ? PTL4_SIZE : 0,
PAGE_SHIFT+p2align, &addr);
error = search_free_space(len, region->map_end,
PAGE_SHIFT + p2align, &addr);
if (error) {
ekprintf("do_mmap:search_free_space(%lx,%lx,%d) failed. %d\n",
len, region->map_end, p2align, error);