| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sizeof(kPower10ExponentTable) = 651 * sizeof(int16_t) = 1302 bytes.
Their equivalence can be confirmed by this test program:
```
const int minIncl = -342;
const int maxExcl = 309;
const int kPower10ExponentTable[] = { etc };
int Power10Exponent(int n) {
return kPower10ExponentTable[n - minIncl];
}
int main(int argc, char** argv) {
for (int n = minIncl; n < maxExcl; n++) {
int formula = (217706 * n >> 16) - 63;
int table = Power10Exponent(n);
if (formula != table) {
return 1;
}
}
return 0;
}
```
Tested by atod_manual_test over the parse-number-fxx-test-data test
cases, with and without manually disabling the EiselLemire code path,
noting that changing the magic 217706 value causes test failures.
PiperOrigin-RevId: 478646550
Change-Id: Icaaf106f9aa36e2de057f3bc9aeddc3ae0efade6
|
|
|
|
|
| |
PiperOrigin-RevId: 478611460
Change-Id: I327dbd1c16a22649e3a25b9ebbc94b48a2fda26f
|
|
|
|
|
| |
PiperOrigin-RevId: 478050535
Change-Id: I8e4a4b01aceb8d712476101633eac0ce8647823a
|
|
|
|
|
|
|
|
|
| |
The current implementation correctly copies up to 15 bytes of data, but the nullify code clears up to 16 bytes, which was likely motivated by the assumption that the length indicator is always the last byte.
This changes limits the nullify to 15 bytes as well removing this layout specific assumption from cord.h, making future platform specific internal layout changes easier to land.
PiperOrigin-RevId: 477997741
Change-Id: Idcdfeca2a005139f97eafcc77111542d90b817af
|
|
|
|
|
|
|
| |
This removes layout specific details from InlineData from cord.cc, making future platform specific internal layout changes easier to land.
PiperOrigin-RevId: 477870559
Change-Id: I26e428ef280d593ad321cf7875e05adcb1cb6438
|
|
|
|
|
|
|
| |
This removes layout specific details from InlineData from cord.h, making future platform specific internal layout changes easier to land.
PiperOrigin-RevId: 477869206
Change-Id: I1d417af47d7f04e34a98ba7b93ae591ece8f9151
|
|
|
|
|
|
|
|
|
|
|
|
| |
Half-open intervals are recommended by Dijkstra:
https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
This also simplifies a static_assert by removing a +1 term.
Also fix a "smaller exponent" copy/pasto.
PiperOrigin-RevId: 477848998
Change-Id: I67af73d37ac08d36a1117ba33313a02932bd5814
|
|
|
|
|
|
|
| |
This makes future platform specific internal layout changes easier to land.
PiperOrigin-RevId: 477843948
Change-Id: I4ca4fdea5e965261c029d08319aba0290721c227
|
|
|
|
|
| |
PiperOrigin-RevId: 477811281
Change-Id: Iba838e0eaceb5e6bfe1dac496fc86a22f5cf31d5
|
|
|
|
|
| |
PiperOrigin-RevId: 477587157
Change-Id: I4527b891222a011f8c1788387479bdc8e4a3bb94
|
|
|
|
|
| |
PiperOrigin-RevId: 477507777
Change-Id: I5ecde3163ca560ac8774034e55654774e36ad230
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This does for float what a recent commit did for double.
Median of 5 runs of "time atod_manual_test pnftd/data/*.txt"
user 0m0.730s # Before
user 0m0.701s # After (a speed-up of 1.04x)
where pnftd is https://github.com/nigeltao/parse-number-fxx-test-data
Part of the reason why this speed-up of 1.04x isn't as dramatic as for
the from_chars<double> change is that, out of the 5299993 pnftd test
cases, 76.42% produce result_out_of_range for single precision (compared
to 1.03% for double precision).
"benchy --reference=srcfs --benchmark_filter='SimpleAtof' :numbers_benchmark"
output (which uses deterministic but randomly generated input strings):
name old cpu/op new cpu/op delta
BM_SimpleAtof<absl::string_view>/10/1 392ns ± 2% 323ns ± 3% -17.60% (p=0.000 n=48+48)
BM_SimpleAtof<absl::string_view>/10/2 426ns ± 3% 311ns ± 4% -26.89% (p=0.000 n=59+49)
BM_SimpleAtof<absl::string_view>/10/4 435ns ± 3% 341ns ± 3% -21.68% (p=0.000 n=58+48)
BM_SimpleAtof<absl::string_view>/10/8 501ns ± 3% 393ns ± 3% -21.55% (p=0.000 n=60+50)
BM_SimpleAtof<const char*>/10/1 409ns ± 6% 339ns ± 3% -17.06% (p=0.000 n=48+49)
BM_SimpleAtof<const char*>/10/2 412ns ± 4% 347ns ± 3% -15.82% (p=0.000 n=47+49)
BM_SimpleAtof<const char*>/10/4 463ns ± 6% 369ns ± 6% -20.37% (p=0.000 n=60+50)
BM_SimpleAtof<const char*>/10/8 548ns ± 3% 450ns ± 4% -17.91% (p=0.000 n=57+59)
BM_SimpleAtof<std::string>/10/1 386ns ± 2% 325ns ± 3% -15.74% (p=0.000 n=48+50)
BM_SimpleAtof<std::string>/10/2 425ns ± 3% 311ns ± 4% -26.79% (p=0.000 n=60+50)
BM_SimpleAtof<std::string>/10/4 435ns ± 4% 340ns ± 3% -21.94% (p=0.000 n=59+49)
BM_SimpleAtof<std::string>/10/8 503ns ± 4% 398ns ± 2% -20.89% (p=0.000 n=59+48)
PiperOrigin-RevId: 476880111
Change-Id: Ibc5583677ac2ed338d09d8db960ae8a513eb2ccb
|
|
|
|
|
|
|
| |
values. Note that %v prints bool values as "true" and "false" rather than "1" and "0".
PiperOrigin-RevId: 475651689
Change-Id: I24b3749d85b5bb7cbc18653d629271a8b2b07d08
|
|
|
|
|
| |
PiperOrigin-RevId: 475636693
Change-Id: Idb7c2b9c36ad8e59f24ff7df179a207d301d9e89
|
|
|
|
|
|
|
| |
types, including integer and floating point values. Users may now specify %v and have the format specifier deduced. Integer values will print according to %d specifications, unsigned values will use %u, and floating point values will use %g. Note that %v does not work for `char` due to ambiguity regarding the intended output. Please continue to use %c for `char`.
PiperOrigin-RevId: 474658166
Change-Id: Iecae39263e368b27232db440535f2bf7da8d863c
|
|
|
|
|
|
|
|
|
| |
absl::strings_internal::OStringStream, and mark that class final.
This should be explicit per https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types, and is currently hard to infer due to multiple inheritance.
PiperOrigin-RevId: 474311032
Change-Id: I72d7adcb9f7a991c19c26bc7083a4df31de5da49
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Eisel-Lemire is a fast Atod algorithm, discussed at
https://nigeltao.github.io/blog/2020/eisel-lemire.html
Median of 5 runs of "time atod_manual_test pnftd/data/*.txt"
user 0m1.477s # Before
user 0m0.746s # After (a speed-up of 1.98x)
where pnftd is https://github.com/nigeltao/parse-number-fxx-test-data
"benchy --reference=srcfs --benchmark_filter='SimpleAtod' :numbers_benchmark"
output (which uses deterministic but randomly generated input strings):
name old cpu/op new cpu/op delta
BM_SimpleAtod<absl::string_view>/10/1 388ns ± 3% 330ns ± 2% -15.06% (p=0.000 n=49+44)
BM_SimpleAtod<absl::string_view>/10/2 428ns ± 3% 320ns ± 2% -25.07% (p=0.000 n=59+49)
BM_SimpleAtod<absl::string_view>/10/4 431ns ± 3% 353ns ± 4% -18.04% (p=0.000 n=59+48)
BM_SimpleAtod<absl::string_view>/10/8 512ns ± 3% 409ns ± 4% -20.18% (p=0.000 n=60+56)
BM_SimpleAtod<const char*>/10/1 411ns ± 4% 341ns ± 3% -17.15% (p=0.000 n=51+49)
BM_SimpleAtod<const char*>/10/2 431ns ± 3% 356ns ± 2% -17.44% (p=0.000 n=58+48)
BM_SimpleAtod<const char*>/10/4 437ns ± 3% 378ns ± 4% -13.49% (p=0.000 n=60+50)
BM_SimpleAtod<const char*>/10/8 552ns ± 2% 450ns ± 4% -18.43% (p=0.000 n=59+59)
BM_SimpleAtod<std::string>/10/1 404ns ± 2% 328ns ± 2% -18.78% (p=0.000 n=48+49)
BM_SimpleAtod<std::string>/10/2 438ns ± 3% 321ns ± 3% -26.81% (p=0.000 n=60+50)
BM_SimpleAtod<std::string>/10/4 446ns ± 2% 354ns ± 3% -20.66% (p=0.000 n=59+50)
BM_SimpleAtod<std::string>/10/8 519ns ± 2% 410ns ± 4% -21.07% (p=0.000 n=59+50)
sizeof(kPower10MantissaTable) doubles from 5208 to 10416 bytes.
PiperOrigin-RevId: 474174891
Change-Id: Iea6f6569419b6b55ab5978994f0adb1f4a8aafb2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on tests.)
Bug: chromium:1292951
PiperOrigin-RevId: 473055916
Change-Id: I40cdd6c87ba9d0a5fb2db5746cff04f14ee829c2
|
|
|
|
|
|
|
| |
to work with modifiers because the meaning of modifiers is type-dependent and `%v` is intended to be used in situations where the type is not important. Please continue using if `%s` if you require format modifiers.
PiperOrigin-RevId: 472534916
Change-Id: I5838761b2b40cbc4344077f23d44b1e634e5bae3
|
|
|
|
|
|
|
| |
functions for readability purposes.
PiperOrigin-RevId: 471622216
Change-Id: Ic28ed8e26d5085ccf20290d1b9c7a5e9bc1f0fde
|
|
|
|
|
|
|
| |
better readability.
PiperOrigin-RevId: 471621696
Change-Id: I603e5707d896deef3a015c70ceac9778e360f72f
|
|
|
|
|
|
|
| |
string-like types (support for other builtin types will follow in future changes). Rather than specifying %s for strings, users may specify %v and have the format specifier deduced. Notably, %v does not work for `const char*` because we cannot be certain if %s or %p was intended (nor can we be certain if the `const char*` was properly null-terminated). If you have a `const char*` you know is null-terminated and would like to work with %v, please wrap it in a `string_view` before using it.
PiperOrigin-RevId: 471321055
Change-Id: Ifbb50082d301baecc7edc277975f12e7ad3ecc8a
|
|
|
|
|
| |
PiperOrigin-RevId: 471292183
Change-Id: Ic124d671dd3b0ae819f741885abb046cbf7e1add
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .cc files in strings/internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 470810568
Change-Id: Ibd316a7e62cc43cb198ba22daed565c9573ce235
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .cc files in strings/internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 468215101
Change-Id: I07fa487bcf2cf62d403489c3be7a5997cdef8987
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .cc files in strings/, except /internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 468205572
Change-Id: Ifce3f1a7a4b2b2c359bf7700a11279bebfef8a15
|
|
|
|
|
| |
PiperOrigin-RevId: 465451170
Change-Id: I5fd161b1ef156d60d7f9a6ecf493bcf802d581e8
|
|
|
|
|
|
|
| |
The change breaks existing code by changing the return type of absl::bit_width.
PiperOrigin-RevId: 465295951
Change-Id: Id4ce7c2ac3699ce22aa2b4851a949f9e0104a3d7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .cc files in strings/, except /internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 465285043
Change-Id: I37e9d1b4c4e9aa655b720da1467927af2aba995e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .h and win32 .inc files.)
Bug: chromium:1292951
PiperOrigin-RevId: 463835431
Change-Id: If8e5f7f651d5cd96035e23e4623bdb08a7fedabe
|
|
|
|
|
| |
PiperOrigin-RevId: 461737981
Change-Id: Iefb1d703725f0a258b5ee315c55277b261b75418
|
|
|
|
|
| |
PiperOrigin-RevId: 461616203
Change-Id: I4cf2e0738451a0471bb8341d9af003d271331fab
|
|
|
|
|
|
|
|
|
| |
The Cord::GetCustomAppendBuffer() method provides the same functionality as Cord::GetAppendBuffer(), except that callers can specify a custom block size/limit if the method returns a newly allocated buffer.
In other words: Cord::GetAppendBuffer() defaults to CordBuffer::CreateWithDefaultLimit(), Cord::GetCustomAppendBuffer() defaults to CordBuffer::CreateWithCustomLimit().
PiperOrigin-RevId: 461231989
Change-Id: I5c03f31139d9b068feee1bea76d59e1c5e30ef07
|
|
|
|
|
| |
PiperOrigin-RevId: 460407142
Change-Id: I9501d2e79cf8c20c5261ab0169bd4bbc3b02980c
|
|
|
|
|
| |
PiperOrigin-RevId: 454305599
Change-Id: I528dfe0223280c379d8791373dc2871ad5812f63
|
|
|
|
|
| |
PiperOrigin-RevId: 454185620
Change-Id: Ifdff33cec4bdd63f160a8d3c18f959ac2a3b6f25
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change introduces the symbol
ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
to guard redundant declarations of static constexpr data
members that are needed prior to C++17.
This change also introduces the symbol
ABSL_INTERNAL_CPLUSPLUS_LANG, which is supposed to be set
to the same value as __cplusplus, except it uses _MSVC_LANG
on MSVC so that the value is correct on MSVC.
Neither of these new symbols should be used outside of Abseil.
Fixes #1191
PiperOrigin-RevId: 453923908
Change-Id: I1316c52c19fa0c168b93cced0c817e4cb7c9c862
|
|
|
|
|
|
|
| |
A few targets were missing `linkopts = ...` and so were not obeying
the project-wide default settings.
Omit any changes to cctz for now, because it's vendored from another project.
|
|
|
|
|
|
|
| |
CordBuffer::IncreaseLengthBy()
PiperOrigin-RevId: 453243686
Change-Id: If109da6be651006d4d9820bcc10eddfb56deaea2
|
|
|
|
|
|
|
|
|
| |
absl::CordBuffer holds data for eventual inclusion within an existing
absl::Cord. CordBuffers are useful for building large Cords that may
require custom allocation of its associated memory, a pattern that is
common in zero-copy APIs.
PiperOrigin-RevId: 453212229
Change-Id: I6a8adc3a8d206691cb1b0001a9161e5080dd1c5f
|
|
|
|
|
|
|
| |
The "deleted" overload error is useless to users. By passing some dummy string to the base class constructor we use a valid constructor and remove the unintended use of the deleted default constructor.
PiperOrigin-RevId: 452826509
Change-Id: I5430a373c8e7e3a13336d2c42899e0e59444620b
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 452110436
Change-Id: I3cb870935932c7e2895c8a7f019f375ad707ee77
|
|/
|
|
|
|
|
|
|
| |
Without the change absl-cpp build fails on this week's gcc-13 snapshot as:
/build/abseil-cpp/absl/strings/internal/str_format/extension.h:34:33: error: found ':' in nested-name-specifier, expected '::'
34 | enum class FormatConversionChar : uint8_t;
| ^
| ::
|
|
|
|
|
| |
PiperOrigin-RevId: 451434783
Change-Id: I572e77a67e18e8dd530bf0347c76863c9bb1946f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See the GCC bug report
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105585
and Abseil bug report
https://github.com/abseil/abseil-cpp/issues/1175
Fixes #1175
PiperOrigin-RevId: 450083136
Change-Id: I207aaffaec9166b335065dd6ef148a721b94048e
|
|
|
|
|
|
|
|
|
| |
pointers as ""
Fixes #1167
PiperOrigin-RevId: 449328725
Change-Id: I813785db77b94efa49eeeff4c93449334c380935
|
|
|
|
|
| |
PiperOrigin-RevId: 448582508
Change-Id: I67fbff5f42a083e093ea2c20749e073ca03feb0b
|
|
|
|
|
|
|
|
|
| |
Stop the absl::Cord destructor from running on the constinit cord in
CordTest.ConstinitConstructor. This allows inspecting the cord at any point
while the test is exiting, which is important for the semantics of the test.
PiperOrigin-RevId: 448327386
Change-Id: Icef9faa2b63f1f0ae60b3430dcf6184f5dead885
|
|
|
|
|
| |
PiperOrigin-RevId: 448075898
Change-Id: Ia4047f833bf27c62752b41f4ba65ab3be88a0181
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--
3d018c03a34bf273a4b24b3584ed77f0a6d21686 by Abseil Team <absl-team@google.com>:
Fix a spelling typo (s/boundries/boundaries).
PiperOrigin-RevId: 442041877
Change-Id: I608020697d37b85316bb9a0838e4b457659c926c
--
518b8119e51db24ce7fb0fd2fe537ec43825c3e6 by Dino Radakovic <dinor@google.com>:
absl/types/internal/variant: Make include guard uppercase
https://google.github.io/styleguide/cppguide.html#The__define_Guard
PiperOrigin-RevId: 441911692
Change-Id: I9837dd07f20204d8253f20627b0917a34dc21825
--
b91696c38310a7cae8c1ea9e2d479495f5dc3f69 by Greg Falcon <gfalcon@google.com>:
Add an internal-only API to wrap __builtin_prefetch() if available.
This private API is intended for future use by the Abseil implementation. Like any internal-namespaced function, it may be changed or removed at any time.
PiperOrigin-RevId: 441894616
Change-Id: Iaa48bd4680b373f4a0d5afab0cb35e2a1908595f
--
0f01e8b0551a662e02dff60840c54320f987315f by Derek Mauro <dmauro@google.com>:
C++20: Use the standard `constinit` keyword for `ABSL_CONST_INIT` when available
PiperOrigin-RevId: 441778874
Change-Id: I70c616469752ff23b326b1c615437599f42cc6aa
GitOrigin-RevId: 3d018c03a34bf273a4b24b3584ed77f0a6d21686
|