Re: When to check the return value of malloc



dj3vande@xxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
CBFalconer <cbfalconer@xxxxxxxxxxxxx> wrote:
Keith Thompson wrote:

The buffer behavior of getc should normally be identical to the
buffer behavior of fgetc.

Not so. The typical action of a getc macro will be something like:

[...]

totally avoiding all system calls until the buffer is emptied.
It's those intermediate system calls that can eat up the
performance.

Here's the fgetc code from a real implementation:

.... snip ...

Where are all those intermediate system calls? I think reality
disagrees with you here.

Nothing forces any implementation to supply such a macro. The
better systems do, if possible.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.


--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages