[Patch] Add _M_grouping_len to the numpunct cache

Benjamin Kosnik bkoz@redhat.com
Wed Jan 14 17:29:00 GMT 2004


Just a minor note, if you look at basic_string, locale::_Impl, others
you'll see that data members for size/length are usually _size, not
_len. Any chance you could do the same for the new additions to numpunct
cache?

appreciated,
benjamin

>the below completes the work, changing the last remaining C-string
>to char array + length. In this case, we avoid both computing again
>and again the string length and also constructing again and again
>a basic_string from an immutable C-string in order to pass the former
>to __verify_grouping. As a side effect, the tweaked __verify_grouping,
>(taking now a const char* and a size_t) is 20 bytes smaller, i.e.,
>576 bytes (-O2, stripped), its speed is the same.
>
>An interesting tweak of this work is that __verify_grouping is not a
>template anymore: I say interesting because, actually, there was _no_
>real reason for that also _before_ the patch: the grouping, according
>to the standard is always a basic_string<char>.
>
>Tested x86-linux, will commit later today if nobody objects.
>
>Paolo.
>
>//////////////
>



More information about the Libstdc++ mailing list