[RFC/Patch] What about using seekoff(-1, ...) for unbuffered underflow?

Benjamin Kosnik bkoz@redhat.com
Fri Jun 6 15:43:00 GMT 2003


>Well, seeking after every _unbuffered getc()_ (vs. buffered and/or sbumpc)!

Right. This is sub-optimal, considering pback can be used. I don't think
you disagree about this part, actually.

>On the other hand, an heavier sbumpc() affects any sbumpc(), buffered or not 
>and I think that, for top performance, people really want a fast unbuffered 
>sbumpc(). 

I'm sympathetic to your purity test on _M_buf_size, but I think your
proposed cure is worse than the disease...

> Also, the underflow call should be checked for its return value.

I'm not convinced of this either. ;)

If this branch is taken, __ret is unchanged regardless of what underflow
returns. If underflow returns eof, then getc will return this on next
input.

Perhaps I'm wrong: if so, show me.

-benjamin




More information about the Libstdc++ mailing list