Newsgroups: comp.unix.questions
Path: utzoo!utgpu!cunews!micor!latour!ecicrl!clewis
From: clewis@ferret.ocunix.on.ca (Chris Lewis)
Subject: Re: sbrk(2) question
Message-ID: <1991Mar20.024327.12600@ferret.ocunix.on.ca>
Date: Wed, 20 Mar 91 02:43:27 GMT
References: <2045@necisa.ho.necisa.oz.au> <4319@skye.ed.ac.uk> <2048@necisa.ho.necisa.oz.au>
Organization: Elegant Communications Inc

In article <2048@necisa.ho.necisa.oz.au> boyd@necisa.ho.necisa.oz.au (Boyd Roberts) writes:
>In article <4319@skye.ed.ac.uk> richard@aiai.UUCP (Richard Tobin) writes:
>>There is no reason for sbrk() and malloc() to "not mix" provided you're
>>careful not to free memory you didn't allocate.

The big trouble is knowing when your sbrk isn't going to free malloc'd memory.

>Well there may be no reason, but in reality most malloc(3) implementations
>assume that it and no one else has called sbrk(2).  I'm sure that pre-System V
>implementations were known to break if you mixed sbrk(2) and malloc(3).

Shore did.  I remember porting V6 stuff to V7, converting to stdio along the
way.  Many things blew out royally.
-- 
Chris Lewis,
clewis@ferret.ocunix.on.ca or ...uunet!mitel!cunews!latour!ecicrl!clewis
Psroff support: psroff-request@eci386.uucp, or call 613-832-0541 (Canada)
**** somebody's mailer is appending .bitnet to my From: address.  If you
