[Patch] Change _M_overflow to call _M_convert_to_external once
Paolo Carlini
pcarlini@unitus.it
Wed May 14 17:11:00 GMT 2003
Hi,
this is my current best proposal, taking into account
Nathan's and Benjamin's suggestions.
A few sparse observations:
1- setbuf(s(!=null), n(==1)) is simply ignored. This is allowed
by the standard and not a big loss, probably, but still a change
of behavior.
2- setbuf(0,0) leads internally to _M_buf_size == 1, that is,
actually, zero-sized get and put areas (null pointers). Using
this value instead of _M_buf_size == 0 simplifies _M_set_buffer.
3- I have renamed _M_set_determinate as _M_set_buffer, and
removed _M_set_indeterminate which was trivially calling
_M_set_determinate.
4- Two tests had to be tweaked: one relied on a BUFSIZ sized put
area, the other on a single-char stdio_filebuf.
5- Before and after this patch, unbuffered basic_filebuf::_M_overflow
and _M_underflow (a.k.a., libstdc++/9404) are still missing.
Benjamin, which strategy do you prefer? Adding a special case to
the current versions would now be easy.
Tested x86-linux.
Thanks,
Paolo.
//////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_over3
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030514/61b2bc82/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_over3
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030514/61b2bc82/attachment-0001.ksh>
More information about the Libstdc++
mailing list