On 03/12/2026 00:36, Paul Eggert wrote:
On 2026-12-02 14:34, Pádraig Brady wrote:
Oh I remembered we already had single locale optimization, so
#if GNULIB_WCHAR_SINGLE_LOCALE && GNULIB_MBRTOWC_SINGLE_THREAD
cache in this case
#endif
What code are you quoting from here? Or are you thinking of adding some
code? Sorry, I'm lost.
Sorry that was pseudo code, for the quick messy test
I did that used obvious caching to test perf.
Given it's about 10 lines total, to avoid this insidious issue,
with now no performance degradation (when configured as above)
It'd still be a significant performance degradation for any app that is
multi-threaded, or that uses multiple locales, right?
Right.
In the bigger picture I'm not seeing the glibc bug as being something
that it's reasonable to expect mcel.h to work around. If MB_CUR_MAX is
incorrectly 1 where it should be 3, surely there are many other parts of
glibc, gnulib, etc. that will go kaflooey; so why work around the glibc
bug only in mcel.h?
It did handle all of coreutils,
but fair enough I agree.
Let's not consider this in gnulib.
cheers,
Padraig