• Eli Zaretskii's avatar
    Make 'mmap_realloc' on MS-Windows more reliable · 8badf953
    Eli Zaretskii authored
    * src/w32heap.c (mmap_alloc): If reserving memory succeeds, but
    committing fails, return NULL.  Don't call GetLastError twice for
    the same API error.
    (mmap_realloc): Zero out MEMORY_BASIC_INFORMATION structures
    before calling VirtualQuery, to avoid using garbled values if the
    call fails.  If committing more pages from the same block fails,
    fall back on mmap_alloc + CopyMemory.  Enhance debugging printouts
    if the call to VirtualAlloc to commit more pages fails.
w32heap.c 23.4 KB