From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp Subject: Re: Memory allocation Date: Sun, 9 Nov 1997 12:31:41 Organization: Aspen Technology, Inc. Lines: 12 Message-ID: <3465ad2d.sandmann@clio.rice.edu> References: Reply-To: sandmann AT clio DOT rice DOT edu NNTP-Posting-Host: dmcap2.dmccorp.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > But I have yet to see a C library that doesn't have `sbrk'. I think > you can pretty much count on it. ACK! What terrible advice! A large fraction (about 30%) of the C compiler/ OS combinations I have had to work with over the last 6 years either don't support sbrk(), have a broken implementation (fun to find), or use of the function completely breaks something in some other library routine. Code for malloc, with a potential ifdef to use sbrk() if it's available and fully tested, and you really need it. So far, the only reason I know of to use sbrk() is when the default malloc is really badly broken in some manner...