This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/Patch] Change _M_overflow to call _M_convert_to_externalonly once


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]