[Patch] Clean up sbumpc, move back _M_buf_size, do not special case unbuffered _M_underflow...

Paolo Carlini pcarlini@unitus.it
Mon Jun 9 19:13:00 GMT 2003


Hi!

this is the patch that I really wanted for many days and of course 
thanks to Nathan for inspiring me behind the scenes.

Basically, it fixes all the issues we know well (the unbuffered seeks 
too!, will post later some polished seek testcases split up from the 
current basic_filebuf/seekoff and seekpos dirs) in a, no so humbly, neat 
way: just state that 'unbuffered' (27.8.1.4 para 10) means _M_buf_size == 1!

I briefly recall here that _M_buf_size the overall allocated buffer size 
which usually (buffered case) includes also the space for the overflow 
char. In the unbuffered case (_M_buf_size == 1), we use that space for 
the single char get area and we don't use it for overflow char!

I guess that Nathan starte wispering that to my ears not less than 1 
months ago, but I never really paid the necessary attention...

Any way, here it is now!

Using regular buffering (no special cases in _M_underflow) solves in a 
straightforward way also the seek issue, since we already have the 
machineery inside seekoff.

Tested x86-linux, seeekoff/* testcases too adapted roughly to the 
unbuffered case too by adding pubsetbuf(0, 0) before the open.

Paolo.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_good
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030609/e70676be/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_good
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030609/e70676be/attachment-0001.ksh>


More information about the Libstdc++ mailing list