sbrk(2) question

Doug Gwyn gwyn at smoke.brl.mil
Tue Mar 19 15:34:48 AEST 1991


In article <2048 at necisa.ho.necisa.oz.au> boyd at necisa.ho.necisa.oz.au (Boyd Roberts) writes:
>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).

The SVR2 version, at least once I got through fixing its bugs, was VERY
careful to allow incrementing uses of sbrk() to be interleaved with
malloc().  (I was impressed!)  Of course, decrementing the break would
cause problems.

Incidentally, the only malloc/free implementation I have ever seen that
didn't have at least one bug is the one in (the draft I reviewed of)
K&R 2nd Edition.



More information about the Comp.unix.questions mailing list