sbrk(2) question

Chris Lewis clewis at ferret.ocunix.on.ca
Wed Mar 20 12:43:27 AEST 1991


In article <2048 at necisa.ho.necisa.oz.au> boyd at necisa.ho.necisa.oz.au (Boyd Roberts) writes:
>In article <4319 at skye.ed.ac.uk> richard at 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 at ferret.ocunix.on.ca or ...uunet!mitel!cunews!latour!ecicrl!clewis
Psroff support: psroff-request at eci386.uucp, or call 613-832-0541 (Canada)
**** somebody's mailer is appending .bitnet to my From: address.  If you



More information about the Comp.unix.questions mailing list