Re: [PATCH v2 0/1] Set _M_string_length before calling _M_dispose()

2023-05-03 Thread kefu chai via Gcc-patches
Le mer. 3 mai 2023 à 20:22, Jonathan Wakely a écrit : > > > On Wed, 3 May 2023 at 03:17, Kefu Chai via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> Hi Jonathan, >> >> Thank you for your review and suggestion. The change looks great! >> Assigning a value with an immediate zero is indeed much f

[PATCH v2 1/1] libstdc++: Set _M_string_length before calling _M_dispose() [PR109703]

2023-05-02 Thread Kefu Chai via Gcc-patches
This patch always sets _M_string_length in the constructor specialized for range of input_iterator, for the cases like istringstream. We copy from source range to the local buffer, and then reallocate to a larger one if necessary. When disposing the old buffer, the old buffer could be provisioned

[PATCH v2 0/1] Set _M_string_length before calling _M_dispose()

2023-05-02 Thread Kefu Chai via Gcc-patches
Hi Jonathan, Thank you for your review and suggestion. The change looks great! Assigning a value with an immediate zero is indeed much faster. in v2: * revised the commit message a little bit, I found it a little bit difficult to parse when re-reading it. * associated the commit with PR/libstd