From: David Powell Newsgroups: comp.os.msdos.djgpp Subject: Re: use memory more than 1MB Date: Thu, 29 Jan 1998 23:45:23 +1100 Organization: The University of Melbourne Lines: 30 Message-ID: <34D079E2.930F0032@usa.net> References: <01bd26e6$b95daea0$0100007f AT localhost> <34C81A06 DOT 18AF AT cs DOT com> <6ab7ec$qmb$1 AT rosenews DOT rose DOT hp DOT com> NNTP-Posting-Host: its-tserv5asy37.its.unimelb.edu.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Andrew Crabtree wrote: > John M. Aldrich wrote in message <34C81A06 DOT 18AF AT cs DOT com>... > >You should NEVER put large objects on the stack, particularly not the > >way you do it here. > I think depending on background many programmers do just this. The 'NEVER' > clause is pretty djgpp specific, not 'C' language specific. Most unixes > will grow > the stack automatically as needed (linux, hpux), and don't have a small > fixed > size one like djgpp. > > >You can also increase the default stack size, but that is a really > >horrid way to get the above code to work. > Sure, for this case it is. But when porting gnu software that uses alloca > heavily > I think increasing stack size is reasonable... > > Andy Well, sorry if I'm being sensible here, but you could always try making the array static, so that it goes in the data seg, where all such hideously large blocks of data belong :-) Of course, you permanantly waste 1 meg, but if it has to be temporary then I'd go with malloc, or if you want to be modern then new.... cya