bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c-strtod: improve error checking


From: Jim Meyering
Subject: Re: c-strtod: improve error checking
Date: Thu, 22 Jan 2009 08:17:38 +0100

Bruno Haible <address@hidden> 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  <address@hidden>
>
>       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

[Prev in Thread] Current Thread [Next in Thread]