[PATCH] D59727: [libc++] Fix return value of snprintf_l() on Windows when buffer is too small

Tom Anderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 11:51:13 PDT 2019


thomasanderson added a comment.

In D59727#1444955 <https://reviews.llvm.org/D59727#1444955>, @zoecarver wrote:

> I mean would it be possible to call `setlocale` directly so it wouldn't have to deal with `__libcpp_locale_guard`. Also, do you know if that is equally as fast as calling `__stdio_common_vsprintf`?


Have a look at the constructor/destructor for `__libcpp_locale_guard`.  It's entire purpose in life is to call `setlocale()`, which is the thing that's slow.  Inlining the `setlocale()` here wouldn't improve speed.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59727/new/

https://reviews.llvm.org/D59727





More information about the llvm-commits mailing list