www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/14/08:00:13

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <3C6BB27C.9BBA44A7@yahoo.com>
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Malloc/free DJGPP code
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1020213162355 DOT 18549C-100000 AT is> <3C6AAB24 DOT 48974C81 AT yahoo DOT com> <9791-Wed13Feb2002213359+0200-eliz AT is DOT elta DOT co DOT il> <3C6AC7A0 DOT 9B1CCE1E AT yahoo DOT com>
Lines: 43
Date: Thu, 14 Feb 2002 12:50:47 GMT
NNTP-Posting-Host: 12.90.173.241
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc05-news.ops.worldnet.att.net 1013691047 12.90.173.241 (Thu, 14 Feb 2002 12:50:47 GMT)
NNTP-Posting-Date: Thu, 14 Feb 2002 12:50:47 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

CBFalconer wrote:
> 
> Eli Zaretskii wrote:
> >
> > > From: CBFalconer <cbfalconer AT yahoo DOT com>
> > > 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).
> 
> Well, back to the drawing board.  Something that is isolated to
> the malloc module is preferable.  I guess I will first look up
> cprintf.

cprintf avoids the blowups, but seems to pay no attention to
'\n'.  The output has line feeds, without <cr>.  Using it also
brings in a long startup delay.

I changed the output strings to terminate in \r\n, and now I get
bright patches of blue on the screen, with no output!  However,
the program didn't crash and did terminate at least. Nothing in
the clib documentation about this behavior.  Any further ideas?

So far all this is simply collecting the tools to investigate -
nothing whatsoever productive.

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   (Remove "XXXX" from reply address. yahoo works unmodified)
   mailto:uce AT ftc DOT gov  (for spambots to harvest)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019