Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - this option is useful for 32-bit os/2 multi-threaded applications. it http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
This option is useful for 32-bit OS/2 multi-threaded applications.  It
requests the code generator to emit a run-time call at the start of any
function that has more than 4K bytes of automatic variables (variables
located on the stack).
Under 32-bit OS/2, the stack is grown automatically in 4K pages for any
threads, other than the primary thread, using the stack "guard page"
mechanism.  The stack consists of in-use committed pages topped off with a
special guard page.  A memory reference into the 4K guard page causes the
operating system to grow the stack by one 4K page and to add a new 4K guard
page.  This works fine when there is less than 4K of automatic variables in
a function.  When there is more than 4K of automatic data, the stack must be
grown in an orderly fashion, 4K bytes at a time, until the stack has grown
sufficiently to accommodate all the automatic variable storage requirements.
 Hence the requirement for a stack-growing run-time routine.  The
stack-growing run-time routine is called __GRO.

The "stack=" linker option specifies how much stack is available and
committed for the primary thread when an executable starts.  The stack size
parameter to _beginthread() specifies how much stack is available for a
child thread.  The child thread starts with just 4k of stack committed.  The
stack will not grow to be bigger than the size specified by the stack size
parameter.

Under Win32 (Windows NT, Windows 95), the stack is grown automatically in 4K
pages for all threads using the stack "guard page" mechanism.  The stack
consists of in-use committed pages topped off with a special guard page.

The "stack=" linker option specifies how much stack is available for the
primary thread when an executable starts.  The "commit stack=" linker
directive specifies how much of that stack is committed when the executable
starts.  If no "commit stack=" directive is used, it defaults to the same
value as the stack size.  The stack size parameter to _beginthread()
specifies how much stack is committed for a child thread.  If the size is
set to zero, the size of the primary thread stack is used for the child
thread stack.  When the child thread executes, the stack space is not
otherwise restricted.

The macro __SW_SG will be predefined if "sg" is selected.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson