When a breakpoint is set after this, Windows Task Manager doesn't show any change in available physical memory.
Shouldn't it ?
invoke VirtualAlloc, NULL, 1024000, MEM_COMMIT, PAGE_READWRITE
Quote from: msdn
MEM_COMMIT
Allocates memory charges (from the overall size of memory and the paging files on disk) for the specified reserved memory pages. The function also guarantees that when the caller later initially accesses the memory, the contents will be zero. Actual physical pages are not allocated unless/until the virtual addresses are actually accessed. [...]
Thanks.
Both the Programmers Reference(OLD) and the 2003 Platform SDK don't have that info.
Andy
That's looks that page allocated when to Windows it's need - but, if it's need from start of program - it's already allocated from global heap seen by Task manager. I ever count this function allocates memory in special pool - and need to use when, small allocations (program critical) need be guaranteed (from this pool), so possible not check NULL-returned values, hoping on Windows memory manager.