[libcxx-commits] [PATCH] D59178: [libc++] Speedup to_string and to_wstring for integers using stack buffer and SSO

Vlad Tsyrklevich via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 6 15:20:30 PDT 2019


vlad.tsyrklevich added a comment.

In D59178#1533262 <https://reviews.llvm.org/D59178#1533262>, @mclow.lists wrote:

> In D59178#1532032 <https://reviews.llvm.org/D59178#1532032>, @vlad.tsyrklevich wrote:
>
> > I tested the following change and verified that it works for the numeric example above, but don't have time to write a test and monitor for build failures so I'm going to revert this change for now. Leaving it here for whoever wants to pick it up:
>
>
> Assuming that I have applied Vlad's patch correctly, I find that it doesn't work.
>
> `to_chars(buf, buf + 100, (int64_t)0x10000000000)` gives a result of `199511627776` instead of `1099511627776`
>  (note the missing zero)


Glad I waited for someone to implement tests! It looks like my approach of comparing against b0/c0 directly doesn't work since it won't 'see' that there need to be leading zeroes added in the c0 case, you need to use v0 directly.


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

https://reviews.llvm.org/D59178





More information about the libcxx-commits mailing list