[comp.sys.ibm.pc] How to set the stack size

swie@cs.umn.edu (S. T. Tan) (05/06/90)

Could anybody tell me how to modify the stack size in Turbo C 2.0 ?

Thanks,
swie@umn-cs.cs.umn.edu

frisk@rhi.hi.is (Fridrik Skulason) (05/07/90)

In article <1990May5.233110.16060@cs.umn.edu> swie@cs.umn.edu (S. T. Tan) writes:
>Could anybody tell me how to modify the stack size in Turbo C 2.0 ?

Add a statement like this one to your code:

                 extern unsigned int _stklen = 15000;

-- 
Fridrik Skulason      University of Iceland  |       
Technical Editor of the Virus Bulletin (UK)  |  Reserved for future expansion
E-Mail: frisk@rhi.hi.is    Fax: 354-1-28801  |   

bakke@plains.UUCP (Jeffrey P. Bakke) (05/07/90)

In article <1681@krafla.rhi.hi.is> frisk@rhi.hi.is (Fridrik Skulason) writes:
>In article <1990May5.233110.16060@cs.umn.edu> swie@cs.umn.edu (S. T. Tan) writes:
>>Could anybody tell me how to modify the stack size in Turbo C 2.0 ?
>
>Add a statement like this one to your code:
>
>                 extern unsigned int _stklen = 15000;
>
You might also want to think about moving up another memory model.  If
your compiling in say, small model, you're limited to 64K maximum for
stack+data+code.  Whereas in say a huge model (please, there's probably
a happy medium for you) you get up to 1Meg stack+data+code (that is to say
the theoretical addressable size).  Something other than small, prehaps `the
compact or medium model is what you should look at.


Jeffrey P. Bakke     | Internet: bakke@plains.NoDak.edu | "Life, don't talk
2550 15th Str S #23B | UUCP    : ...!plains!bakke       |  to me about life..."
Fargo, ND  58105     | BITNET  : bakke@plains           |   - Marvin

raymond@pepto-bismol.berkeley.edu (Raymond Chen) (05/08/90)

In article <1990May5.233110.16060@cs.umn.edu> swie@cs.umn.edu (S. T. Tan) writes:
>Could anybody tell me how to modify the stack size in Turbo C 2.0 ?

Take out your Turbo C 2.0 Reference Guide, and open it to the index.
Look for the word "stack".  You'll see this:

	stack 67, 81, 235
		length 30
		overflow logic 438
		...

Turn to page 30.  Bingo, instant answer.

Total time:  10 seconds, which includes 4 seconds to walk over to your
bookshelf to grab the manual.  (Yes, I timed myself.)
--
raymond@math.berkeley.edu     Maintainer of the csip Frequently Asked Questions