Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac,att!emory!gatech!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: sbrk(2) question Message-ID: <15515@smoke.brl.mil> Date: 19 Mar 91 05:34:48 GMT References: <2045@necisa.ho.necisa.oz.au> <4319@skye.ed.ac.uk> <2048@necisa.ho.necisa.oz.au> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 13 In article <2048@necisa.ho.necisa.oz.au> boyd@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.