X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Wed, 13 Feb 2002 21:33:59 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <9791-Wed13Feb2002213359+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <3C6AAB24.48974C81@yahoo.com> (message from CBFalconer on Wed, 13 Feb 2002 18:08:10 GMT) Subject: Re: Malloc/free DJGPP code References: <3C6AAB24 DOT 48974C81 AT yahoo DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: CBFalconer > Newsgroups: comp.os.msdos.djgpp > Date: Wed, 13 Feb 2002 18:08:10 GMT > > > And if unbuffered I/O is too slow, call setvbuf with a suitable buffer > > instead. That should avoid the need to call malloc the first time printf > > is called. > > Nope, that didn't do it. Sorry, I forgot that malloc is called in the startup code, so calling setvbuf in `main' is too late. I guess the easiest way out of this mess is to use cprintf instead of printf. Or move the setvbuf call into malloc itself, before the first printf (with some kind of static flag, to do that only once).