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.
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?
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?
