mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
7e780e57d4
Moves some isbig checks into string.h, enabling smarter optimizations to be made on small strings. Also we no longer zero out our string prior to calling the various constructors, buying back the performance we lost on big strings when we made the small-string optimization. We further add a little optimization to the big_string copy constructor: if the string is using half or more of its capacity, then we don’t recompute capacity and just take the old string’s. As well, the copy constructor always makes a small string when it will fit, even if copied from a big string that got truncated. This also reworks the test to follow the idiom adopted elsewhere re stl, and adds a helper function to tell if a string is small based on data(). |
||
---|---|---|
.. | ||
ctl | ||
dsp | ||
libc | ||
libcxx | ||
math | ||
net | ||
posix | ||
tool | ||
BUILD.mk |