[Patch] Tweak unbuffered overflow, provide unbuffered seek testcases

Paolo Carlini pcarlini@unitus.it
Thu Jun 12 08:27:00 GMT 2003


Benjamin Kosnik wrote:

>>There are *dozens* of testcases of this type in the testsuite!
>>    
>>
>Incorrect test cases should definitely be fixed as you find them. For
>this particular case, you'll have to flush or seek inbetween the output
>and input.
>
Ok, I agree with you and Nathan that actually this is the way to go, in 
particular with an eye (as mentioned explicitly by Nathan) to future 
changes to our implementation which could rightfully be less tolerant.

Our current so-called unified-type filebuf implementation (for the 
casual reader: see _M_move_out_cur to understand what I mean) tolerates 
mixes of reads and writes with _no_ virtuals in between, but, as well 
known nowadays, this offers little real advantages to the user (which 
application needs to really do many reads and writes on consecutive file 
positions without seeks in between?) and, on the other hand, leads, 
unavoidably to much slower sustained throughput (again, for the casual 
reader: compare the cost of the current _M_move_out_cur with that of 
_M_out_cur++: consider that this cost is _not_ amortized but has to be 
paid for _each_ char get or put!).

Anyway: if you allow me a couple more days, I will change completely 
seekoff and seekpos testcases to always do a seek between get -> put and 
put -> get.

>Please use .tst as the extension for input files that are read/write and
>can be modified by test files. They eventually get compared to a
>corresponding .txt file that should match the final .tst contents.
>(Don't worry about this last bit at the moment, just get the extension
>right for the files that you add.)
>
100% agreed!

Paolo.



More information about the Libstdc++ mailing list