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: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2020-07-10 14:39:20 +03:00 committed by Alexandre Julliard
parent 2b2341cb36
commit 5498ebd8c0
1 changed files with 8 additions and 2 deletions

View File

@ -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) ||