-=> Quoting Cameron Clark to Anthony Tibbs
AT> Q. How do I change the stack size?
AT> A. The size of the stack of a Turbo C++ program is determined at
AT> run time by the global variable _stklen. To change the size
AT> to, for example, 10,000 bytes, include the following line in
AT> your program:
AT>
AT> extern unsigned _stklen = 10000;
CC> That's the strangest thing I've ever seen (runtime adjustment).
CC> Are there any sideffects to changing the variable at different
CC> places?
That's not runtime adjustment... the startup code references _stklen to
figure out how much stack to allocate. If you aren't overriding the _stklen
that is in their libraries, you'll get their amount.
If you override it twice, however, the linker will complain about multiple
references. If you change it at runtime, it will have no effect because the
runtime code that changes the stack size has already run, and won't be run
again...
... I am Witness of Borg. Have you been assimilated?
--- FastEcho 1.46
---------------
* Origin: House of Fire BBS - Toronto - (416)601-0085 - v.34 (1:250/536)
|