Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!ucsd!ucsdhub!sdsu!roetzhei From: roetzhei@sdsu.UUCP (William Roetzheim) Newsgroups: comp.lang.c Subject: What goes on stack? Message-ID: <3221@sdsu.UUCP> Date: 20 Oct 88 15:16:51 GMT Reply-To: roetzhei@sdsu.UCSD.EDU (William Roetzheim) Organization: San Diego State University, Math/Sciences Dept. Lines: 28 Help! I'm working with Turbo C version 1.5. My program is large (about 30,000 lines) and deals with large arrays (static and dynamic) and many string literals in the code. The stack size required is huge. Anything less than about 55K for a stacksize causes a stack overflow on program execution. I've looked at the obvious: 1. I don't do any recursion; 2. I don't pass a huge number of paramaters to anything, maybe an average of two or three paramaters; 3. The program is not heavily nested. From a top level routine down to the lowest level 'put a character to the screen' I probably have 15 levels of nesting. Other than return addresses, register values, and paramaters, what else does Turbo C put on the stack? What the heck would cause it to grow so big? This really is a problem because Turbo C appears to allocate the stack in the global data segment (is this true), thus leaving me no room for some global data I want to work with. Correct me if I'm wrong, but passing arrays (including arrays of pointers) should be no problem because they are passed by reference, thus costing only 4 bytes (I'm using the large memory model). Any help would be appreciated. William