/Gs Compiler Option
| Syntax: |
Default: |
| /Gs[+|-] |
/Gs- |
Use /Gs to remove stack probes from the generated code.
Stack probes go into the prolog of every function with more
than 2K of stack storage. Your application can therefore run
faster if /Gs+ is used. However, you should not remove stack
probes unless your application meets any of the following
criteria:
You
use the /ST[ACK]:reserve[,commit] linker option to commit
more memory than is needed to store all local variables.
Your
application has only one thread. The stack is fully
allocated for the first thread.
- You guarantee that the stack will always be allocated.
For example, you could write a guard routine to run once
at the beginning of each thread and serially access each
page, leaving the last page as a guard page.
- Your local variables require less than 2K of storage on
the stack.
By default, stack probes are not removed.

Stack Probes

Summary of Compiler Options