This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC/Patch] Change _M_overflow to call _M_convert_to_externalonly once
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: pcarlini at unitus dot it, libstdc++ at gcc dot gnu dot org
- Date: Mon, 12 May 2003 16:12:57 -0500
- Subject: Re: [RFC/Patch] Change _M_overflow to call _M_convert_to_externalonly once
- References: <3EBE80E8.2080601@unitus.it><3EBF548E.6070907@unitus.it>
>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