Description
Updated description
Virtual memory is something that high performance applications tend to do. I think it would be great if they had the ability to run their memory allocation test suites under miri.
#3605 already tracks changes to mmap
such that we can do virtual memory things with it under miri.
On Windows, the API to deal with virtual memory is VirtualAlloc
and VirtualFree
:
VirtualAlloc(0, size, MEM_RESERVE, PAGE_READWRITE); // reserve
VirtualAlloc(ptr, size, MEM_COMMIT, PAGE_READWRITE); // commit
VirtualFree(ptr, 0, MEM_RELEASE); // release
The minimal set relevant flags is MEM_RESERVE and MEM_COMMIT for VirtualAlloc; and MEM_RELEASE on VirtualFree. There is also MEM_DECOMMIT, which could be useful too.
https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc
https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualfree
TODO @yanchith Provide runnable example.