1 /* $Id: _alloca.c,v 1.1.1.2 2009/09/04 00:27:36 gmcgarry Exp $ */
3 * This explanation of _alloca() comes from Chris Giese, posted to
6 * By default, Windows reserves 1 meg of virtual memory for the stack.
7 * No page of stack memory is actually allocated (commited) until the
8 * page is accessed. This is demand-allocation. The page beyond the
9 * top of the stack is the guard page. If this page is accessed,
10 * memory will be allocated for it, and the guard page moved downward
11 * by 4K (one page). Thus, the stack can grow beyond the initial 1 meg.
12 * Windows will not, however, let you grow the stack by accessing
13 * discontiguous pages of memory. Going beyond the guard page causes
14 * an exception. Stack-probing code prevents this.