[RFC/Patch] Change _M_overflow to call _M_convert_to_external only once
Benjamin Kosnik
bkoz@redhat.com
Mon May 12 21:14:00 GMT 2003
>A note: privately, Nathan suggested that perhaps it's better having
>_M_buf_size equal to current _M_buf_size + 1 (thus matching the actual
>allocated memory). In that case some hunks posted yesterday would
>disappear, whereas a few new appear for _M_set_determinate and
>_M_underflow (_M_buf_size - 1 there)
This is an interesting idea, here are my comments.
1) _M_buf_size should reflect allocated memory. Furthermore, it should
match BUFSIZE since this is optimal transfer size.
2) Therefore, _M_out_end should just be _M_buf + _M_buf_size - 1 or
something like this. I would think this would be all you'd have to do,
but I'm probably wrong... :)
This hackery, and the reason for it, should be duly noted in a comment
explaining that we're trying to keep the conversion calls to a minimum
while still keeping the output writes at an optimal size.
Maybe this is helpful?
-benjamin
More information about the Libstdc++
mailing list