4 ms·
On windows you can do this with RESERVE, e.g. MEM_RESERVE from https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc https://l
by malkia 3y ago
On windows you can do this with RESERVE, e.g. MEM_RESERVE from https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc https://learn.microsoft.com/en-us/windows/win32/api/memoryap... - For example when you have a callstack (on Windows), it can reserve (say) 1MB of contigous space, but then only "commit" some parts of it, and the tail (head?) be sort of guard page, in order to "commit" more from the reserve.
Now getting commit from reserve might fail, as you've mentioned because Windows does not overcommit, but it's possible to a degree.
I guess same with really large vector can be done.