"When you enter a function (VC++ with the stack checking enabled), it will call the _chkstk located in CHKSTK.ASM. This function does a stack page probing and causes the necessary pages of memory to be allocated using the guard page scheme, if possible."
Conversation
The doc literally says "_chkstk() increases the stack when needed by committing some of the pages previously reserved for the stack". How did you miss that?
3
1
I did provide a source in the other tweet reply, but here it is again. You will find a lot more in stackoverflow if you simply google it.
1
1
1
I think you are confusing _chkstk from MingwGCC with __chkstk from VC++. Both are different.
1
1
Thinking that _chkstk catches anything, or that it directly allocates pages is a complete misunderstanding of how stack growing works. Stack pages are allocated by the kernel, whenever the guard pages are hit. Probing is necessary so that a single logical allocation can't skip 1/
Show replies

