summaryrefslogtreecommitdiff
path: root/absl
Commit message (Collapse)AuthorAge
...
| * Replace the kPower10ExponentTable array with a formula.Gravatar Abseil Team2022-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * CMake: Mark absl::cord_test_helpers and absl::spy_hash_state PUBLICGravatar Abseil Team2022-10-03
| | | | | | | | | | PiperOrigin-RevId: 478611460 Change-Id: I327dbd1c16a22649e3a25b9ebbc94b48a2fda26f
| * Use trivial relocation for transfers in swisstable and b-tree.Gravatar Evan Brown2022-10-03
| | | | | | | | | | PiperOrigin-RevId: 478547898 Change-Id: Ie20cd0a49df042be912888ee238333a5f5fa0404
| * Merge pull request #1284 from t0ny-peng:chore/remove-unused-class-in-variantGravatar Copybara-Service2022-10-03
| |\ | | | | | | | | | | | | PiperOrigin-RevId: 478500346 Change-Id: Ia15746857db3068ca74e95a447c5cc26f9450d94
| * | Removes the legacy spellings of the thread annotation macros/functionsGravatar Derek Mauro2022-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by default. The compatibility macro `ABSL_LEGACY_THREAD_ANNOTATIONS` can be defined on the compile command-line to temporarily restore these spellings. All of the thread annotation macros are available under ABSL_ prefixed spellings in `absl/base/thread_annotations.h`. The compatibility macro and the legacy spellings will be removed in the future. See https://github.com/google/fuzztest/issues/41 PiperOrigin-RevId: 478498273 Change-Id: I120ad6480d031642bf95a11bf72ab883d9161810
* | | Update charconv.ccGravatar Randolf J2022-10-02
|/ /
| * chore: Remove unused helper ConversionIsPossible.Gravatar Hao Peng2022-10-01
|/
* Allows absl::StrCat to accept types that implement AbslStringify()Gravatar Abseil Team2022-09-30
| | | | | PiperOrigin-RevId: 478050535 Change-Id: I8e4a4b01aceb8d712476101633eac0ce8647823a
* Merge pull request #1283 from pateldeev:any_inovcable_rename_trueGravatar Copybara-Service2022-09-30
|\ | | | | | | | | PiperOrigin-RevId: 478009291 Change-Id: I136dffd1383e42ae499c318132e9d789f3a859b9
* | Cleanup: SmallMemmove nullify should also be limited to 15 bytesGravatar Martijn Vels2022-09-30
| | | | | | | | | | | | | | | | | | 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
* | Cleanup: implement PrependArray and PrependPrecise in terms of InlineDataGravatar Martijn Vels2022-09-29
| | | | | | | | | | | | | | 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
* | Cleanup: Move BitwiseCompare() to InlineData, and make it layout independent.Gravatar Martijn Vels2022-09-29
| | | | | | | | | | | | | | 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
| * Rename True alias.Gravatar pateldeev2022-09-29
|/
* Change kPower10Table bounds to be half-openGravatar Abseil Team2022-09-29
| | | | | | | | | | | | 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
* Cleanup some InlineData internal layout specific details from cord.hGravatar Martijn Vels2022-09-29
| | | | | | | This makes future platform specific internal layout changes easier to land. PiperOrigin-RevId: 477843948 Change-Id: I4ca4fdea5e965261c029d08319aba0290721c227
* Improve the comments on the implementation of format hooks adl tricks.Gravatar Matt Kulukundis2022-09-29
| | | | | PiperOrigin-RevId: 477811281 Change-Id: Iba838e0eaceb5e6bfe1dac496fc86a22f5cf31d5
* Expand LogEntry method docs.Gravatar Andy Getzendanner2022-09-29
| | | | | | | | | In particular: * point to LOG mutator methods that can affect their values * point out lifetime hazards with ABSL_ATTRIBUTE_LIFETIME_BOUND PiperOrigin-RevId: 477725823 Change-Id: I38cb434b300ceea3cceb2c42eb406bba8e1049d4
* Documentation: Remove an obsolete note about the implementation of `Cord`.Gravatar Abseil Team2022-09-28
| | | | | PiperOrigin-RevId: 477587157 Change-Id: I4527b891222a011f8c1788387479bdc8e4a3bb94
* `absl::base_internal::ReadLongFromFile` should use `O_CLOEXEC` and handle ↵Gravatar Abseil Team2022-09-28
| | | | | | | interrupts to `read` PiperOrigin-RevId: 477547252 Change-Id: Icc94290511b5071d15584d59dcd9cf6ad7319e2b
* Allows absl::StrFormat to accept types which implement AbslStringify()Gravatar Abseil Team2022-09-28
| | | | | PiperOrigin-RevId: 477507777 Change-Id: I5ecde3163ca560ac8774034e55654774e36ad230
* Add common_policy_traits - a subset of hash_policy_traits that can be shared ↵Gravatar Evan Brown2022-09-28
| | | | | | | | | | between raw_hash_set and btree. Also remove the transfer implementations from btree_set.h and flat_hash_set.h, which are equivalent to the default implementations. Motivation: this will simplify upcoming changes related to trivial relocation. PiperOrigin-RevId: 477493403 Change-Id: I75babef4c93dec3a8105f86c58af54199bb1ec9c
* Split configuration related to cycle clock into separate headersGravatar Abseil Team2022-09-26
| | | | | PiperOrigin-RevId: 477043101 Change-Id: I009ea39ad61e7e78cdac51afc57a8ad5b4d8aa2d
* Fix -Wimplicit-int-conversion and -Wsign-conversion warnings in btree.Gravatar Abseil Team2022-09-26
| | | | | | | | | | | Certain core libraries in Chrome build with these warnings [1]; btree_map and btree_set cannot be used in those libraries until these warnings are fixed. [1] https://crbug.com/1292951 PiperOrigin-RevId: 476908396 Change-Id: I32e9ea1eec911e329d6ff00f04fa2e9cfde8660a
* Implement Eisel-Lemire for from_chars<float>Gravatar Abseil Team2022-09-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Import of CCTZ from GitHub.Gravatar Abseil Team2022-09-25
| | | | | PiperOrigin-RevId: 476742468 Change-Id: I99267ad1194b119b59f341ef5044c8836de5bf0e
* Adds support for "%v" in absl::StrFormat and related functions for bool ↵Gravatar Abseil Team2022-09-20
| | | | | | | values. Note that %v prints bool values as "true" and "false" rather than "1" and "0". PiperOrigin-RevId: 475651689 Change-Id: I24b3749d85b5bb7cbc18653d629271a8b2b07d08
* De-pointerize LogStreamer::stream_, and fix move ctor/assign preservation of ↵Gravatar Andy Getzendanner2022-09-20
| | | | | | | flags and other stream properties. PiperOrigin-RevId: 475643360 Change-Id: I061c167da8e45f79c2487f172190adb0177a6c10
* Explicitly disallows modifiers for use with %v.Gravatar Abseil Team2022-09-20
| | | | | PiperOrigin-RevId: 475636693 Change-Id: Idb7c2b9c36ad8e59f24ff7df179a207d301d9e89
* Change the macro ABSL_IS_TRIVIALLY_RELOCATABLE into a type trait - ↵Gravatar Evan Brown2022-09-20
| | | | | | | | | | | | | | | | | | | | | | absl::is_trivially_relocatable - and move it from optimization.h to type_traits.h. Example of how to change to the new type trait: ``` #include "absl/base/attributes.h" if (ABSL_IS_TRIVIALLY_RELOCATABLE(T)) { DoSomething(); } ``` to ``` #include "absl/meta/type_traits.h" if (absl::is_trivially_relocatable<T>::value) { DoSomething(); } ``` Note that optimization.h is also built in C mode so we can't put a type trait there. PiperOrigin-RevId: 475633715 Change-Id: I2bc85f3f6711d1280049fd01eb97c497d2d0d929
* Add sparse and string copy constructor benchmarks for hash table.Gravatar Abseil Team2022-09-20
| | | | | PiperOrigin-RevId: 475601161 Change-Id: I3f67a1597ddfa6de60f19fe4b38d44fbc5630bd8
* Make BTrees work with custom allocators that recycle memory.Gravatar Abseil Team2022-09-19
| | | | | | | | | | | | The btree data structure poisons regions of memory it's not using. It leaves these regions poisoned when it frees memory. This means that a custom memory allocator that tries to reuse freed memory will trigger an ASAN use-after-poison error. The fix is to unpoison each memory region right before freeing it. PiperOrigin-RevId: 475309671 Change-Id: I29d55c298d3d89a83e1f960deb6e93118891ff83
* Add the fact that CHECK_OK exits the program to the comment of CHECK_OK.Gravatar Abseil Team2022-09-16
| | | | | PiperOrigin-RevId: 474916555 Change-Id: Ie6fc9186006280e4db3730ea67c2d99b6faff121
* Adds support for "%v" in absl::StrFormat and related functions for numeric ↵Gravatar Abseil Team2022-09-15
| | | | | | | 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
* Implement correct move constructor and assignment for ↵Gravatar Andy Getzendanner2022-09-14
| | | | | | | | | 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
* Add more options for `BM_iteration` in order to see better picture for ↵Gravatar Abseil Team2022-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | choosing trade off for iteration optimizations. ``` BM_Iteration/1/1 1.83ns ± 0% BM_Iteration/2/2 2.63ns ±11% BM_Iteration/4/4 5.76ns ±26% BM_Iteration/7/7 3.79ns ± 0% BM_Iteration/10/10 8.49ns ±23% BM_Iteration/15/15 18.2ns ±30% BM_Iteration/16/16 21.2ns ±29% BM_Iteration/54/54 37.2ns ±21% BM_Iteration/100/100 74.7ns ±13% BM_Iteration/400/400 330ns ± 8% BM_Iteration/0/0 0.46ns ± 2% BM_Iteration/10/0 1.26ns ± 1% BM_Iteration/100/0 13.4ns ± 0% BM_Iteration/1000/0 417ns ± 0% BM_Iteration/10000/0 3.30µs ± 0% BM_Iteration/100/1 16.0ns ±12% BM_Iteration/1000/10 453ns ± 5% ``` PiperOrigin-RevId: 474282700 Change-Id: I4b3fcb80292147aa4a8f542ae5c7fc1e8bd5f05b
* Change `EndComparison` benchmark to not measure iteration. Also added ↵Gravatar Abseil Team2022-09-13
| | | | | | | | | | | | | | | | | | `BM_Iteration` separately. ``` BM_EndComparison 0.46ns ± 0% BM_Iteration/10/10 8.09ns ± 7% BM_Iteration/20/20 18.6ns ±16% BM_Iteration/100/100 79.0ns ±15% BM_Iteration/400/400 344ns ± 5% BM_Iteration/100/1 16.6ns ± 1% BM_Iteration/1000/10 454ns ± 3% ``` PiperOrigin-RevId: 474211728 Change-Id: I9bd799a4be3247ca8f2a2144b6e857db8c99c81f
* Implement Eisel-Lemire for from_chars<double>Gravatar Abseil Team2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add `-llog` to linker options when building log_sink_set in logging internals.Gravatar Greg Falcon2022-09-13
| | | | | | | In Android builds this library calls __android_log_write directly, and so needs this linker dep. PiperOrigin-RevId: 474080654 Change-Id: I19f6ac4f78e635541ccad08ec9e553adfe609b3f
* Apply clang-format to btree.h.Gravatar Evan Brown2022-09-13
| | | | | PiperOrigin-RevId: 474060540 Change-Id: Ie0f24dfa6ec724eaa9eca82de5f73bbd8d622e38
* Improve failure message: tell the values we don't like.Gravatar Abseil Team2022-09-13
| | | | | PiperOrigin-RevId: 474043469 Change-Id: I9ea33a8bf026263c9e10d2a183014a5ee8df1306
* Increase the number of per-ObjFile program headers we can expect.Gravatar Abseil Team2022-09-13
| | | | | PiperOrigin-RevId: 474017481 Change-Id: I1be222fa38ad01f6ddbcddd610f9629fd4888777
* Fix "unsafe narrowing" warnings in absl, 8/n.Gravatar Abseil Team2022-09-12
| | | | | | | | | | | | | | | 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 */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 473868797 Change-Id: Ibe0b76e33f9e001d59862beaac54fb47bacd39b2
* Fix format string error with an explicit castGravatar Derek Mauro2022-09-08
| | | | | PiperOrigin-RevId: 473088472 Change-Id: If4fb8354490821cbaf53743f51bf0b0d2ba85895
* Add a case to detect when the Bazel compiler string is explicitly set to "gcc",Gravatar Derek Mauro2022-09-08
| | | | | | | | | | | | | | | instead of just detecting Bazel's default "compiler" string. When Bazel auto-configures GCC, it sets the compiler string to "compiler", probably for backwards compatibility. Some users manually set the string to "gcc". This should address the backwards compatibility issues described in https://github.com/bazelbuild/bazel/issues/12707 and hopefully fix https://github.com/abseil/abseil-cpp/issues/1263 PiperOrigin-RevId: 473069817 Change-Id: I8a24721f63f9d61447b22b3b05b06a9dde7d34d8
* Fix "unsafe narrowing" warnings in absl, 10/n.Gravatar Abseil Team2022-09-08
| | | | | | | | | | | | | | | 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
* Fix "unsafe narrowing" warnings in absl, 9/n.Gravatar Abseil Team2022-09-08
| | | | | | | | | | | | | | | 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 miscellaneous non-test source files.) Bug: chromium:1292951 PiperOrigin-RevId: 473054605 Change-Id: Ifd7b24966613ca915511a3a607095508068200b8
* Fix stacktrace header includesGravatar Derek Mauro2022-09-08
| | | | | | | Fixes #1275 PiperOrigin-RevId: 472990940 Change-Id: I1251b01b09e6a9baac52ae4df443714432115e90
* Add a missing dependency on :raw_logging_internalGravatar Abseil Team2022-09-07
| | | | | | | | | | | | | internal/stacktrace_x86-inl.inc includes internal/raw_logging.h and therefore needs a direct dependency to satisfy Bazel layering_check (Clang -fmodules-strict-decluse). Clang before https://reviews.llvm.org/D132779 does not report the issue becasue: * internal/stacktrace_x86-inl.inc is an .inc file and is not checked as a main file * internal/stacktrace_x86-inl.inc is a textual header and older Clang incorrectly considers there is no requesting module and suppresses the error. PiperOrigin-RevId: 472795469 Change-Id: Ia4ad667ea80b2590cef1adfd22af025c8df826ac
* Fixes bug so that `%v` with modifiers doesn't compile. `%v` is not intended ↵Gravatar Abseil Team2022-09-06
| | | | | | | 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
* Convert algorithm and container benchmarks to cc_binaryGravatar Derek Mauro2022-09-06
| | | | | PiperOrigin-RevId: 472521745 Change-Id: Ia76cd720d1036dce05f6332f41a2ff748b3ea971