Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Limit to array size under cc? Message-ID: <570@cresswell.quintus.UUCP> Date: 24 Jan 88 02:32:28 GMT References: <3537@ames.arpa> <594X@esunix.UUCP> Organization: Quintus Computer Systems, Mountain View, CA Lines: 19 Summary: stack limit not compiled-in In article <594X@esunix.UUCP>, rushfort@esunix.UUCP (Kevin Rushforth) writes: > This is not a limit on the size of an array imposed by your compiler, > but rather a limit on the stack size imposed by your OS. 4.2/4.3 based > Unix systems (as well as others) have compiled in limits on stack size > (the csh command "limit" will tell you how much). The limit is not compiled-in. (There may be a compiled-in limit, but the number Csh will tell you is usually well below it.) For example, % limit stacksize on my machine just now reported stacksize 512 kbytes I then said % limit stacksize 2M and it raised the limit to 2 megabytes. This isn't really a good idea. 4BSD systems also have a rather nice function alloca(size) allocates that much space in the stack; it will go away when the calling function returns. The stack size limit applies to alloca() as well as to explicitly declared arrays.