X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Fri, 15 Feb 2002 14:29:24 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <7680-Fri15Feb2002142924+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: <3C6CF755.CC35209E@yahoo.com> (message from CBFalconer on Fri, 15 Feb 2002 11:58:27 GMT) Subject: Re: Malloc/free DJGPP code References: <3C6C735D DOT A6D16719 AT yahoo DOT com> <1225-Fri15Feb2002084500+0200-eliz AT is DOT elta DOT co DOT il> <3C6CC93C DOT 6F9E05E6 AT yahoo DOT com> <2947-Fri15Feb2002112947+0200-eliz AT is DOT elta DOT co DOT il> <3C6CF755 DOT CC35209E 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: Fri, 15 Feb 2002 11:58:27 GMT > > But that doesn't explain why the static 'firstime' control failed? I think it failed because malloc is called from the startup code more than once. So the condition guarded the very first call, but not the others. > The file system to receive 'write' has no more reason to be > initialized at that point than does cprintf, does it? The call to `write' doesn't need any initializations, assuming you write to handles 1 or 2, which are already preconnected when the program starts. `write' is more or less straightforward path to a DOS call (you can use `_write' if you want to be even closer to the DOS call, but in that case, you will need to use "\r\n" to end a line).