]> code.delx.au - gnu-emacs/commit
Make 'mmap_realloc' on MS-Windows more reliable
authorEli Zaretskii <eliz@gnu.org>
Sun, 14 Feb 2016 17:46:29 +0000 (19:46 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 14 Feb 2016 17:46:29 +0000 (19:46 +0200)
commit8badf953da5e629bc67db113719b72412270dabd
tree4afa7a657a8f0308949e4f5555b26ebe23607283
parent856cd948d1a5a016ad36721246a049d33451902f
Make 'mmap_realloc' on MS-Windows more reliable

* 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.
(Bug#22526)
src/w32heap.c