This patch is fixing unittests for sanitizer memory allocator.
There was two issues:
- The VirtualAlloc can't reserve twice a memory range. The memory space used by the SizeClass allocator is reserved with NoAccess and pages are commited on demand (using MmapFixedOrDie).
- The address space is allocated using two VirtualAlloc calls. The first one for the memory space, the second one for the AdditionnalSpace (after).
On windows, they need to be freed separately.
Which is more common, committing previously reserved memory or reserve+committing a large chunk of memory? We should do the common one first.
Also, this needs a comment that VirtualAlloc with MEM_RESERVE will fail if the memory was previously reserved, and in that case we should only pass MEM_COMMIT.