So you'd rather ensure that we hold one or more anonymous maps reserving everything above 0x80000000 (except for NT emulations, assuming the 3G emulation is to be preferred, or there's an option for 3G), and when the system needs to allocate something there, free a portion of the anonymous map and reallocate?
Something like that yes. It means we need to keep track of the allocations in that area, which cannot be done with the existing mechanism since we currently rely on the kernel to manage the free space. So there's a bit of work involved.
Doesn't the list in VIRTUAL_FirstView hold all that is needed? If we reserve the whole lot, it seems to me that the only parts that would need to be added in there would be the parts that are below the 0xc0000000 boundary and were allocated before we get in to claim the range.
On related matters, looking at the code that calls mmap yesterday, I noticed that a VirtualAlloc with MEM_RESERVED (the flag to reserve a range of virtual addresses under windows) does not use the MAP_NORESERVE flag (the flag to prevent the system from allocating swap space for the mapped range) - is there a reason for this? If we're going to be mapping 1GB+ chunks of memory it would seem imperative that MAP_NORESERVE be used where available and we have no immediate plans to actually use the memory.