Multiple times during work on sanitizers, I've hit a situation where the shadow memory initialization (done via mmap) would overwrite some existing memory. This patch changes MmapFixedNoReserve to add a safety check to fail when something already occupies the region we're trying to map into, and introduces MmapFixedNoReserveAllowOverwrite which explicitly allows overwriting memory. Same for MmapFixedNoAccess and MmapFixedNoAccessAllowOverwrite.
The patch implements this for Darwin only currently, but if there's a some Linux and Windows API to do the same, I'll be happy to add them.
misaligned