Bruno Haible <br...@clisp.org> wrote:
> Paolo Bonzini wrote:
>> > +  c_locale = newlocale (LC_ALL_MASK, "C", (locale_t)0);
>>
>> Can we cache c_locale in a static variable?
>
> This would make sense for speed, yes. (Think of calling c_strtod in a loop,
> like it is done in getloadavg.c.) Here is a proposed patch. OK, Jim?

Yes, thanks!

> 2009-01-21  Bruno Haible  <br...@clisp.org>
>
>       Cache the C locale object.
>       * lib/c-strtod.c (c_locale_cache): New variable.
>       (c_locale): New function.
>       (C_STRTOD): Use it, and don't call freelocale.
>       * m4/c-strtod.m4 (gl_C_STRTOD, gl_C_STRTOLD): Require AC_C_INLINE.
>       Suggested by Paolo Bonzini.


Reply via email to