delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/30/10:34:09

Date: Sun, 30 Aug 1998 17:33:24 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Adam Brown <adambrown1 AT geocities DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Display question...
In-Reply-To: <35E8845B.27B0@geocities.com>
Message-ID: <Pine.SUN.3.91.980830173020.20257c-100000@is>
MIME-Version: 1.0

On Sun, 30 Aug 1998, Adam Brown wrote:

> This is because DJGPP was programmed with a bloody-minded adherence to
> the ANSI C standard, which states that the printf buffer does not need
> to be flushed at the end of the call.

No, it's because flushing the buffer at the end of each call would make 
`printf' prohibitively expensive, due to the mode-switches from protected 
mode to real mode and back that are required for each call to DOS.

Consider the following snippet:

	for (i = 32; i <= 255; i++)
	  printf ("%c", i);
	printf ("\n");

If DJGPP would flush the buffer for every printf, this would run hundreds 
of times slower than it does today.

- Raw text -


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