This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/Patch] What about using seekoff(-1, ...) for unbufferedunderflow?


>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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]