delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/14/07:46:17

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
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: <Pine DOT SUN DOT 3 DOT 91 DOT 971109123555 DOT 11475E-100000 AT is>
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

> 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...

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019