Commit 5498ebd8 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Stop search on mmap() error in try_map_free_area().

The anon mmap errors do not depend on start address hint. Ignoring them makes the search take incredible time until it fails. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2b2341cb
......@@ -1009,8 +1009,14 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
return start;
TRACE( "Found free area is already mapped, start %p.\n", start );
if (ptr != (void *)-1)
munmap( ptr, size );
if (ptr == (void *)-1)
{
ERR( "wine_anon_mmap() error %s, range %p-%p, unix_prot %#x.\n",
strerror(errno), start, (char *)start + size, unix_prot );
return NULL;
}
munmap( ptr, size );
if ((step > 0 && (char *)end - (char *)start < step) ||
(step < 0 && (char *)start - (char *)base < -step) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment