/STACK

Syntax:

/STACK:reserve[,commit]

Sets the size of the stack in bytes.

The reserve argument specifies the total stack allocation in virtual memory. The default stack size is 1MB. The linker rounds up the specified value to the nearest 4 bytes.

The optional commit argument is subject to interpretation by the operating system. In Windows NT 4 and Windows 2000, it specifies the amount of physical memory to allocate at a time. Committed virtual memory causes space to be reserved in the paging file. A higher commit value saves time when the application needs more stack space but increases the memory requirements and possibly startup time.

Specify the reserve and commit values in decimal or C-language notation. (Use the digits 1-9 for decimal values, precede octal values with zero (0), and precede hexadecimal values with zero and x (0x or 0X).

An alternate way to set the stack is with the STACKSIZE statement in a .DEF file. STACKSIZE overrides Stack Allocations (/STACK) if you specify both. You can change the stack after the executable file is built by using the EDITBIN.EXE tool. For more information, see Editing Files with EDITBIN.

To set these options in the visual development environment, type values in the Reserve and Commit boxes in the Output category of the Link tab in the Project Settings dialog box.