Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!munnari.oz.au!metro!cluster!necisa!boyd From: boyd@necisa.ho.necisa.oz.au (Boyd Roberts) Newsgroups: comp.unix.questions Subject: Re: sbrk(2) question Message-ID: <2048@necisa.ho.necisa.oz.au> Date: 19 Mar 91 00:39:03 GMT References: <1991Mar8.180132.12025@Think.COM> <4296@skye.ed.ac.uk> <6582@auspex.auspex.com> <4312@skye.ed.ac.uk> <2045@necisa.ho.necisa.oz.au> <4319@skye.ed.ac.uk> Organization: NEC Information Systems Australia Pty. Ltd. Lines: 18 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. On the other hand, >there's not usually a good reason to not just use malloc(). > 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). I could be wrong, but I know I've been burnt by this before. Don't call sbrk(2) after malloc(3). Core dumps assured. Boyd Roberts boyd@necisa.ho.necisa.oz.au ``When the going gets wierd, the weird turn pro...''