Asri-unix.398 net.unix-wizards utzoo!decvax!ucbvax!menlo70!sri-unix!dan@BBN-UNIX Fri Jan 1 20:11:38 1982 Re: stack space From: Dan Franklin The problem with allocating that data on main's stack is that the size of the stack can vary significantly depending on the size of the environment of the person running the program and the argument list. If someone with a Concept 100 TERMCAP entry in their environment invokes a command with a starname that matches lots of filenames, the stack could easily end up 1kb larger than the implementer expected. Note that if the allocation is made even slightly too large, the stack uses the whole next 8K segment, so you really lose big. One way to get around this is to write a small assembly-language routine which will enlarge the stack enough to leave 1k or so for lower-level C function stack frames, and return the address and size of the area. Such storage could be difficult to take full advantage of. On our 11/70 I wrote a prefree() routine for alloc which inserted a given piece of storage into the arena for future use; this seems like the most convenient way to make such "static automatic" storage available. On the whole, though, changing estabur seems better (it's certainly simpler to use!). ----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen of http://communication.ucsd.edu/A-News/ This Usenet Oldnews Archive article may be copied and distributed freely, provided: 1. There is no money collected for the text(s) of the articles. 2. The following notice remains appended to each copy: The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.