--
04cb3b22497190170aa5b774e98080c5de2ba60b by Abseil Team <absl-team@google.com>:
Alternative bit mixer for LowLevelHash on ARM
LowLevelHash's bit-mixer is inefficient on ARM because it calculates a 128-bit product of two 64-bit numbers. On ARM, this requires a sequence of two instructions with a high combined latency and poor throughput. This change provides alternative bit-mixing code for ARM that uses only 64-bit arithmetic (multiplication, xor, and left-shifts) and speeds things up considerably.
The bit-mixing code for ARM was inspired by by Woothash[1] and xxh3[1]. Once I landed on a sequence of operations that provided good mixing, I used a test harness to search for the combination of shift / rotate factors that provided the best mixing, as indicated by SMHasher hash quality tests. The new mixing code passes 13 out of 15 of the hash quality test suites in SMHasher, with the two failures being in the noise range: e.g. 1 collision vs. zero expected in a keyset of ~8m keys.
[1]: https://github.com/tommyettinger/waterhash/blob/49f5cf0b63b9/woothash.h#L16-L20
[2]: https://github.com/Cyan4973/xxHash/blob/6853ddc36e46/xxhash.h#L3240-L3265
PiperOrigin-RevId: 391833008
--
17a4de1f9d623155c75b19285d414cd55a487cd6 by Saleem Abdulrasool <abdulras@google.com>:
debugging: add support for unwinding on RISCV Linux
This adds partial support for unwinding the RISCV call stack. It is largely
duplicated from the AArch64 support with alterations for the ELF RISCV psABI.
This covers RISCV64 and RISCV32, though not the ILP32E calling convention.
PiperOrigin-RevId: 391818522
--
32c93e449327b2cea32b32f6365e84b420fe1ed3 by Gennadiy Rozental <rogeeff@google.com>:
New storage for types smaller than 8 bytes.
Also adding new read interface for types smaller than or rqual to 8 bytes to avoid passing the pointer.
PiperOrigin-RevId: 391726822
--
e987ac08a7787801cbfc7d7c96649e97fa8cff1a by Abseil Team <absl-team@google.com>:
Extern template `find_first_non_full` to reduce linkage size for TU with single not inlined function.
PiperOrigin-RevId: 391718862
--
73af9bfcb5bf045089133e18bbd20eb5bb699172 by Gennadiy Rozental <rogeeff@google.com>:
Make most non-mutable most int128 methods and friend free functions constexpr.
Some functions are implemented offline (at least in some configurations) and can't be made constexpr. Mutable methods can't be made constexpr until we drop c++11 support.
Fixes#978
PiperOrigin-RevId: 391706535
GitOrigin-RevId: 04cb3b22497190170aa5b774e98080c5de2ba60b
Change-Id: If051fad5ff004e2e82fa53618fc04a6fe3d2d4be
--
84bcdcd9497d1ec989f50c8dee93f656507c7bd6 by Abseil Team <absl-team@google.com>:
Reduce length of the `flat_hash_map<std::string, V>` type name in order to reduce binary bloat.
PiperOrigin-RevId: 391560997
--
5f49bd435e066989851dc045c7786ef400413f66 by Greg Falcon <gfalcon@google.com>:
Claim a bit from the Cord refcount for future use.
Also rename the increasingly-inaccurately named "Refcount" class to "RefcountAndFlags".
In optimized builds, this adds an extra mask instruction to decrement and test operations, but no new branches. Future flags can be added at no extra cost. Each additional flag will of course reduce the range of our refcount, but even with the bit added, we still support refcounts of 500 million.
PiperOrigin-RevId: 391557567
GitOrigin-RevId: 84bcdcd9497d1ec989f50c8dee93f656507c7bd6
Change-Id: I051823bf5a9a42d4fa9200e39563ab585ecab331
--
3a9b4e8e5ecba532db5cc4ac12d12660307ce9fb by Derek Mauro <dmauro@google.com>:
Use the Bazel @platforms repository for platform constraints
Fixes#1000
PiperOrigin-RevId: 390644226
--
b34e4d2f8a86b54bd483ec4c9c3dd781ad2d8b68 by Abseil Team <absl-team@google.com>:
debugging: add some handling for RISC-V
The RISC-V architecture uses a downward growing stack and can host Linux using
ELF files. Adjust a few sites accordingly to indicate how to handle the RISC-V
architecture.
PiperOrigin-RevId: 390631894
--
5fa3a0961bf3dd0799c048956a0128f7b8113f1e by Samuel Benzaquen <sbenza@google.com>:
Rename the buffer hash function to LowLevelHash.
Although it started as wyhash, it will depart from it so it does not make sense
to keep the name.
PiperOrigin-RevId: 390483506
--
2e7867a2301d58ad4cd5abcaa5fd6f0db973ae7b by Abseil Team <absl-team@google.com>:
This is an internal change.
PiperOrigin-RevId: 390349746
GitOrigin-RevId: 3a9b4e8e5ecba532db5cc4ac12d12660307ce9fb
Change-Id: I322c3762552a2107e6c6b108c25c01e5efa8aecd
--
667d6502169b645de44d5aa79ff7524c329ef136 by Abseil Team <absl-team@google.com>:
Improve the error messages for absl::Substitute to clarify that an unescaped $ symbol is an error.
The existing functionality enforces that unescaped $ results in a compile-time error. However, the current error messages do not mention this case and make it easier to miss while looking for an incorrect numerical substitution argument.
PiperOrigin-RevId: 390242485
GitOrigin-RevId: 667d6502169b645de44d5aa79ff7524c329ef136
Change-Id: Iad1f1c18ab9686be11d40772e3d51dd233cfc9bc
--
228b5878d7a994656f383666cfaee34e33e0b09b by Abseil Team <absl-team@google.com>:
Add element_type typedef to match std::span<T>
PiperOrigin-RevId: 390186160
--
c91d96c88c60be793c525158f76dfcaa5e32d161 by Abseil Team <absl-team@google.com>:
Rollback change to only hide retired flags if human-readable output
is requested
PiperOrigin-RevId: 390183146
--
170192c10ef8d513de80f29298ce93eeccc3712c by Abseil Team <absl-team@google.com>:
Move alignas(16) before ABSL_CONST_INIT and ABSL_DLL.
PiperOrigin-RevId: 390182845
--
77a5ee5081c81cef625fac7bbcf993cc028b32ed by Evan Brown <ezb@google.com>:
Use simple SlotOffset and AllocSize logic instead of container_internal::Layout in order to save linker input size for non-opt and sanitizer builds.
In opt mode, all of this logic is inlined so we don't save linker input size in opt mode.
PiperOrigin-RevId: 389914594
GitOrigin-RevId: 228b5878d7a994656f383666cfaee34e33e0b09b
Change-Id: I3b904068687574931d8390071b322c0c3c083283
--
77cd6291781bc39e8472c706163d6951fe2ae573 by Derek Mauro <dmauro@google.com>:
absl::uint128: Use intrinsics for more operations when available
This change also inlines the division and modulus operators when
intrinsics are available for better code generation.
Fixes#987
PiperOrigin-RevId: 389895706
--
fa23339584599e07ebcb4d0a857e2553b017757c by Abseil Team <absl-team@google.com>:
only hide retired flags if human-readable output is requested
PiperOrigin-RevId: 389835452
--
f1111f2b88359d4b253d4d81681c8a488458a36e by Martijn Vels <mvels@google.com>:
Add helpers IsFlat(), IsExternal(), etc to improve readability
PiperOrigin-RevId: 389779333
--
785b8712261e41695ebeeb64b4317f93b37adc11 by Martijn Vels <mvels@google.com>:
Split off 'concat' and 'btree' RepMemoryUsageLeaf and RepMemoryUsageDataEdge
PiperOrigin-RevId: 389701120
--
5264bffebffc2b377bf7e18f0ce69a3ed38c6629 by CJ Johnson <johnsoncj@google.com>:
Eagerly destroy `Callback` in `absl::Cleanup`
PiperOrigin-RevId: 389678813
--
a05312f0668458e97c50ca932c8f974c1508ebf2 by Abseil Team <absl-team@google.com>:
Have one instance of empty_group per program, rather than one per translation unit.
https://stackoverflow.com/questions/185624/static-variables-in-an-inlined-function
PiperOrigin-RevId: 389185845
GitOrigin-RevId: 77cd6291781bc39e8472c706163d6951fe2ae573
Change-Id: Iac8d9cb27707a9562c831c77a552d1fb4bb0405f
--
93c607726d663800b4bfa472cba043fd3f5d0e97 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 389158822
--
55b3bb50bbc168567c6ba25d07df2c2c39e864af by Martijn Vels <mvels@google.com>:
Change CordRepRing alternative implementation to CordRepBtree alternative.
This changes makes CordRepBtree (BTREE) the alternative to CordRepConcat (CONCAT) trees, enabled through the internal / experimental 'cord_btree_enabled' latch.
PiperOrigin-RevId: 389030571
--
d6fc346143606c096bca8eb5029e4c429ac6e305 by Todd Lipcon <tlipcon@google.com>:
Fix a small typo in SequenceLock doc comment
PiperOrigin-RevId: 388972936
--
e46f9245dce8b4150e3ca2664e0cf42b75f90a83 by Martijn Vels <mvels@google.com>:
Add 'shallow' validation mode to CordRepBtree which will be the default for internal assertions.
PiperOrigin-RevId: 388753606
--
b5e74f163b490beb006f848ace67bb650433fe13 by Martijn Vels <mvels@google.com>:
Add btree statistics to CordzInfo, and reduce rounding errors
PiperOrigin-RevId: 388715878
--
105bcbf80de649937e693b29b18220f9e6841a51 by Evan Brown <ezb@google.com>:
Skip length checking when constructing absl::string_view from `const char*`.
The length check causes unnecessary code bloat.
PiperOrigin-RevId: 388271741
--
bed595158f24839efe49c65ae483f797d79fe0ae by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 387713428
GitOrigin-RevId: 93c607726d663800b4bfa472cba043fd3f5d0e97
Change-Id: I2a4840f5ffcd7f70b7d7d45cce66f23c42cf565f
* GenerateRealFromBits: sign is already set
If std::is_same<SignedTag, GeneratePositiveTag>::value then sign is
already set to zero thanks to:
uint_type sign = std::is_same<SignedTag, GenerateNegativeTag>::value
? (static_cast<uint_type>(1) << (kUintBits - 1))
: 0; // <- here
So the conditional is unnecessary.
* Update generate_real.h
Remove extra parenthesis
Co-authored-by: Derek Mauro <761129+derekmauro@users.noreply.github.com>
--
e1a0989213908927f05002ab7697955ad7dc5632 by Martijn Vels <mvels@google.com>:
Introduce CordRepBtreeReader
CordRepBtreeReader provides forward navigation on cord btrees with absolute positional (offset) context, iterating over btree data in absl::string_view chunks.
PiperOrigin-RevId: 387585161
--
206d298e2bccb998731995cb05717b31fa9d90ec by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 387577465
--
f07fafe8a400a4f5dfef186d1a3b61fb7f709fe5 by Abseil Team <absl-team@google.com>:
This change adds debug-build enforcement that the inputs to
absl::c_set_intersection are sorted, which is a prerequisite of
std::set_intersection and required for correct operation of the
algorithm.
PiperOrigin-RevId: 387446657
--
2ca15c6361bb758be7fb88cae82bf8489b4d3364 by Abseil Team <absl-team@google.com>:
Change BadStatusOrAccess::what() to contain status_.ToString()
This ensures that on uncaught exception propagation that would cause program termination, the message contains information on the error which caused the failure.
Lazy initialization of what_ is a value judgement: if most callers are expected to call status() not what(), lazy initialization is correct. If most callers are expected to call what(), it should be initialized on construction to avoid atomic operation overhead.
PiperOrigin-RevId: 387402243
--
3e855084e104dc972a0c4385395e6d8e8465127f by Gennadiy Rozental <rogeeff@google.com>:
LSC: Standardize access to GoogleTest flags on GTEST_FLAG_GET/GTEST_FLAG_SET
This change is necessary to move Googletest flags out of the testing:: namespace without breaking code. These new macros will continue to be required for code that needs to work both inside Google's monorepo and outside in OSS, but can be used anywhere inside the monorepo.
PiperOrigin-RevId: 387396025
--
1ccf5895a15059ef689af5c4817d7b84f73190be by Gennadiy Rozental <rogeeff@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 387388496
GitOrigin-RevId: e1a0989213908927f05002ab7697955ad7dc5632
Change-Id: I3606d9ce29d909a3555e662e9df564202cf5068d
--
69b5d0b2a5adb49a53e51f9da6848eaa484242fe by Derek Mauro <dmauro@google.com>:
Changes the absl::Duration factory functions to disallow types that
are convertible to int or double, instead requiring that the argument
itself is indeed an integer or a floating-point number. This will
prevent callers from passing arguments, such as std::atomic<T>.
This change is an API break. Information and a tool to fix issues
can be found at
https://abseil.io/docs/cpp/tools/upgrades/duration-conversions
PiperOrigin-RevId: 387153494
--
786063e438ab6a55ac4baa88ad4d20a8293be52a by Evan Brown <ezb@google.com>:
Make ctrl_t be an enum class.
This adds type safety, and also when strict aliasing is enabled, the compiler will know that control bytes can't alias non-control bytes.
Also make H2() return h2_t.
PiperOrigin-RevId: 387120717
--
7e537aabec1c255d6e7c9d21232c597c1c2077bf by Evan Brown <ezb@google.com>:
Add some missing `const` keywords to ctrl_t* function parameters.
PiperOrigin-RevId: 386976062
--
da53ac6d91cabd951e81dd0a145e1e52b918955f by Martijn Vels <mvels@google.com>:
Change Seek and InitOffset to return nullptr instead of assert / fail.
This makes it consistent with the rest of the API (Next, Previous, Skip) and hardens it against invariants that are harder (or less likey) to be upheld correctly by the caller.
PiperOrigin-RevId: 386963283
--
a4d1faac020d5025edf53ce81808e5db68da7d89 by Abseil Team <absl-team@google.com>:
PC / Backtrace / Symbolization for Emscripten.
PiperOrigin-RevId: 386957724
--
97f2c47d83ba9d3ac89e1f55bd06897686ffd063 by Martijn Vels <mvels@google.com>:
Fix static casts ([-Wimplicit-int-conversion])
PiperOrigin-RevId: 386951646
--
9530c795248543817cbc4013953baa09c35f5e1a by Abseil Team <absl-team@google.com>:
Fix incorrect header guard in cord_rep_btree_navigator.h
PiperOrigin-RevId: 386907904
--
90ce5872406df2b7f4c428683741dc13a572267e by Abseil Team <absl-team@google.com>:
Small grammar fixes for some StatusCode descriptions.
PiperOrigin-RevId: 386906217
--
b30a2fd777f12a04a4d512f37a34614b0d05ce99 by Derek Mauro <dmauro@google.com>:
Skip length checking when constructing absl::string_view from std::string.
The length check causes unnecessary code bloat.
PiperOrigin-RevId: 386857974
--
fa171536c359bfa2a1b80297e844519bb9ee7791 by Martijn Vels <mvels@google.com>:
Introduce CordRepBtreeNavigator
CordRepBtreeNavigator implements bi-directional navigation over all data edges stored inside a Cord Btree.
PiperOrigin-RevId: 386519102
GitOrigin-RevId: 69b5d0b2a5adb49a53e51f9da6848eaa484242fe
Change-Id: I1b35188d66133f8cb73d346bc5564aac4e0b3e80
--
50f4b71699a116d95b72e8cc4c0a98433fac51a0 by Evan Brown <ezb@google.com>:
Split reset_ctrl and set_ctrl out of raw_hash_set to avoid redundant memory accesses.
In the previous member functions, the compiler has to assume that `ctrl_` can alias `this` so it has to reload the other member variables unnecessarily.
Note: I tried adding __restrict__ to the ctrl arguments in the new functions, but it didn't result in further binary changes.
PiperOrigin-RevId: 386074009
--
47dfd737cc484492f9af9452e3a49adf81fe2ad2 by Abseil Team <absl-team@google.com>:
rehash_and_grow_if_necessary in-place more aggressively.
It previously resized too eagerly, resulting in low load factors.
PiperOrigin-RevId: 386008094
--
05321b4841ffe685813897a1ec86abc8fdf54093 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 385810140
GitOrigin-RevId: 50f4b71699a116d95b72e8cc4c0a98433fac51a0
Change-Id: I9c9571564adc1f9ccfa9b29d3aac238389397d1b
--
c3b926ea986eea9d416ef57ee67a1041b70257fd by Martijn Vels <mvels@google.com>:
Remove internal absl_internal_cordz_disabled check.
PiperOrigin-RevId: 384225993
--
2863c56ad5c86dd9c207a796e65d5bc968f77755 by Benjamin Barenblat <bbaren@google.com>:
Make randen_slow endian-correct
Pay attention to the platform endianness when pulling bytes out of each
AES block, and use platform-endian round keys.
PiperOrigin-RevId: 383878281
GitOrigin-RevId: c3b926ea986eea9d416ef57ee67a1041b70257fd
Change-Id: I0d48f4fd560b3e320260ef05790727756ffead02
--
007ce045d5d38a727ededdb5bf06e64785fd73bd by Martijn Vels <mvels@google.com>:
Add `cord_enable_btree` feature flag (default false).
PiperOrigin-RevId: 383729939
--
98e7dc6a0407b0fd7b8713d883cdb3a766e0583d by Benjamin Barenblat <bbaren@google.com>:
Eliminate some byte swapping from randen_slow
Stop swapping bytes when serializing randen_slow’s Vector128 into and
out of memory. Instead, simply index different bytes in the AES round
function. This requires byte swapping the te{0..3} lookup tables, but it
produces an 8% speedup on my Xeon W-2135.
PiperOrigin-RevId: 383689402
--
180b6bf45049188840d439b16a28e6b968669340 by Evan Brown <ezb@google.com>:
Minor simplification in drop_deletes_without_resize() - save probe_offset outside the lambda.
Also, add some consts, avoid an auto, and use lambda capture by value instead of reference.
I realized that the compiler can already optimize this - https://godbolt.org/z/Wxd9c4TfK, but I think this way makes the code a bit clearer.
PiperOrigin-RevId: 383646658
--
781706a974c4dc1c0abbb6b801fca0550229e883 by Martijn Vels <mvels@google.com>:
Change storage to contain 3 bytes.
As per the comments in the code, this allows us to utilize all available space in CordRep that may otherwise be 'lost' in padding in derived clases. For the upcoming CordrepBtree class, we want a strong guarantee on having a 64 bytes aligned implementation.
PiperOrigin-RevId: 383633963
--
8fe22ecf92492fa6649938a2215934ebfe01c714 by Derek Mauro <dmauro@google.com>:
Remove reference to str_format_arg.h, which no longer exists
PiperOrigin-RevId: 383517865
--
79397f3b18f18c1e2d7aea993b687329d626ce64 by Benjamin Barenblat <bbaren@google.com>:
Use absl::uint128 for AES random number generator
Replace randen’s internal 128-bit integer struct, u64x2, with
absl::uint128. This eliminates some code and improves support for
big-endian platforms.
PiperOrigin-RevId: 383475671
GitOrigin-RevId: 007ce045d5d38a727ededdb5bf06e64785fd73bd
Change-Id: Ia9d9c40de557221f1744fb0d6d4d6ca7ac569070
--
1620e8ffaa93ef24510ca60c7fff2a07248ac9f6 by Abseil Team <absl-team@google.com>:
Update comment.
PiperOrigin-RevId: 382858259
--
20db116f28469149d10e0f7f8b976cb903dd4879 by Gennadiy Rozental <rogeeff@google.com>:
Add benchmark running on multiple flags.
Update size_tester to include cost of absl::GetFlag call.
Add size_tester invocation for bool flag.
New benchmark better represent GetFlag usage.
PiperOrigin-RevId: 382820341
--
2e097ad3811c4e329f75b98877a5e74c1d3d84fd by Abseil Team <absl-team@google.com>:
Avoid 64x64->128 multiplication in absl::Hash's mix on AArch64
On AArch64, calculating a 128-bit product is inefficient, because it requires a sequence of two instructions to calculate the upper and lower halves of the result. So calculate a 64-bit product instead.
Making MultType 64-bits means the upper 32 bits of the result do not participate in shift/xor, but the add/multiply gives us sufficient mixing.
PiperOrigin-RevId: 382625931
--
f3ae3f32cb53168c8dc91b766f2932dc87cec503 by Abseil Team <absl-team@google.com>:
Remove homegrown Round implementation
absl/time/duration.cc defined a Round implementation to accommodate old
versions of MSVC that lacked std::round(long double). Abseil no longer
supports those MSVCs, so we don’t need the homegrown implementation
anymore. Remove it, and replace calls to it with std::rint.
PiperOrigin-RevId: 382605191
--
a13631c91bf5478289e1a512ce215c85501a26f7 by Martijn Vels <mvels@google.com>:
Move the Consume() conversion functions out of cord_rep_ring into cord_rep_consume.
This makes these functions generic, so we can repurpose these for the new Btree conversion functions.
PiperOrigin-RevId: 382594902
--
7394c737500c2d8371fcf913b21ad1b321ba499d by Benjamin Barenblat <bbaren@google.com>:
Remove homegrown Round implementation
absl/time/duration.cc defined a Round implementation to accommodate old
versions of MSVC that lacked std::round(long double). Abseil no longer
supports those MSVCs, so we don’t need the homegrown implementation
anymore. Remove it, and replace calls to it with std::rint.
PiperOrigin-RevId: 382569900
--
d72a761f43dc5c9b9510c3a1363177ed26646b5d by Abseil Team <absl-team@google.com>:
Prefer `getentropy` for Emscripten.
It needs a different header, so I've separated it out from the GLIBC
check above.
PiperOrigin-RevId: 382332475
--
74e261dbb467741b2ddd8b490e04c531fdd2f559 by Martijn Vels <mvels@google.com>:
Add BTREE tag for CordRepNode implementing a Btree cord.
This change only forward declared the CordRepBtree class (not implemented yet) and defines the enum value BTREE. While RING and BTREE should never co-exist, we define a new value for BTREE so as not to make transitioning between RING and BTREE harder than it needs to be. This changes shifts the FLAT value / computation from FLAT = 4 to FLAT =5
PiperOrigin-RevId: 382326710
GitOrigin-RevId: 1620e8ffaa93ef24510ca60c7fff2a07248ac9f6
Change-Id: Ia8f99dde3874808f56062bd37ab3e63764099734
--
373171b46238585c818cec37af26959f5412f813 by Abseil Team <absl-team@google.com>:
Build with -Wl,-no-undefined.
PiperOrigin-RevId: 381276748
--
da32624792d2948fe83d0ce58794d505799ab5d0 by Benjamin Barenblat <bbaren@google.com>:
s/round/rint/ in exponential_biased
`rint` differs from `round` in that it uses the current FPU rounding
mode. It’s thus potentially faster, since it doesn’t have to save and
restore FPU state. It also is more reflective of developer intent –
most developers expect all FPU operations to use the current rounding
mode, and having exponential_biased follow that rule seems ideal.
PiperOrigin-RevId: 381268264
--
8f860253a4283d2cc8230fe98d7cdf7bcb3e05f1 by Abseil Team <absl-team@google.com>:
Internal change.
PiperOrigin-RevId: 381264180
GitOrigin-RevId: 373171b46238585c818cec37af26959f5412f813
Change-Id: Iefe60b15c80318a7707e0c32159ac004bfa26d72
--
2684e80d877b688b8d9e0af1b7acddbadc973152 by Evan Brown <ezb@google.com>:
Add an insert codegen function for raw_hash_set_benchmark.
PiperOrigin-RevId: 381052237
--
8394ef3071714a41484cb5b271cba0611d954a7a by Abseil Team <absl-team@google.com>:
Optimize raw_hash_set ctor for random-access iterators
PiperOrigin-RevId: 380832215
GitOrigin-RevId: 2684e80d877b688b8d9e0af1b7acddbadc973152
Change-Id: Icf7929fdfab50a1b26f3dc5505575363b4f5838d
--
f6d1ddef9a38e3fb8492181bf1a7a006b7f2145d by Abseil Team <absl-team@google.com>:
Update the implementation of `operator<<` in Status to use `ToString(StatusToStringMode::kWithEverything)`
PiperOrigin-RevId: 380740880
--
5f13b20c4b85c1c6e94b69c74f80f8f3f3941747 by Derek Mauro <dmauro@google.com>:
Update Docker images
This also disables the Clang/libstdc++/C++20 combo as it seems that
the latest libstdc++ is relying on C++20 Concepts to a greater extent
than Clang supports.
PiperOrigin-RevId: 380714572
--
f8f4dee12cfd02559bf741ad6b06f10ac0c48c73 by Abseil Team <absl-team@google.com>:
Fix shadow member warnings in randen_hwaes.cc
These happen when attempting to use abseil in github.com/google/benchmark. The project sets -Wshadow.
The warning is due to the name of the Vector128 ctor parameter. Using v instead, which I see used elsewhere (e.g. line 290)
PiperOrigin-RevId: 380704197
--
2e1a09e9cb1239485715acb4828d9b4799fcfbb5 by Tom Manshreck <shreck@google.com>:
Add more precise documentation for AbslParseFlag declarations in the Time API
PiperOrigin-RevId: 380649107
--
153e5f7a960c03e4161c03737a0ff18ba377ff73 by Evan Brown <ezb@google.com>:
Make the number of control bytes a constant.
We use a constexpr function because we need to support C++11, which doesn't have inline variables.
The motivation is to avoid future bugs where the number changes and we forget to update all the places it's used.
This CL should be a no-op.
PiperOrigin-RevId: 380253975
GitOrigin-RevId: f6d1ddef9a38e3fb8492181bf1a7a006b7f2145d
Change-Id: Id584138f898bf3ebef95fabcf48e41098c4db954
--
b1fc72630aaa81c8395c3b22ba267d938fe29a2e by Derek Mauro <dmauro@google.com>:
Fix -Wdeprecated-copy warnings from Clang 13.
Example:
error: definition of implicit copy assignment operator for 'UDT' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
PiperOrigin-RevId: 380058303
--
0422744812b1a2010d9eea5b17fbe89f3441b66b by Evan Brown <ezb@google.com>:
Change the "full table!" asserts in raw_hash_set to use `<= capacity` instead of `< capacity`.
If we add support for non-power-of-two-minus-one capacities, this is the correct thing to assert. For example, consider: Group::kWidth = 8, capacity_ = 8, ctrl_ = {kEmpty, 1, 2, 3, 4, 5, 6, 7, kSentinel, kEmpty, 1, 2, 3, 4, 5, 6}. In this case, if we do an unsuccessful lookup with H2 mapping to slot 1, then the first Group will contain {1, 2, 3, 4, 5, 6, 7, kSentinel} so we need to continue to the second Group (at which point seq.index() == 8 == capacity_) to find a kEmpty.
Note: this is a no-op change for now since we never have `capacity % Group::kWidth == 0`.
PiperOrigin-RevId: 380033480
--
40628c34d540356de65fabb16c1439c0ec7a0764 by Abseil Team <absl-team@google.com>:
Drop out-of-date documentation about `absl::FixedArray`'s allocator support
PiperOrigin-RevId: 379811653
--
e7ad047863ae55c9b7aec0753cfc527a4ea614bc by Evan Brown <ezb@google.com>:
Fix a bug in ConvertDeletedToEmptyAndFullToDeleted in which we were copying 1 more cloned control byte than actually exists.
When alignof(slot_type)>1, this wouldn't cause a problem because the extra byte is padding.
Also change loop bounds to not rely on the fact that capacity_+1 is a multiple of Group::kWidth.
PiperOrigin-RevId: 379311830
--
1a3ba500fb2c33205854eb9258cd6e0fb1061bca by Martijn Vels <mvels@google.com>:
Change Ring, EXTERNAL and FLAT tag values to be consecutive values
The purpose of this change is to have FLAT = EXTERNAL + 1. Especially in the ring and btree alternative code, there is a common check if a node is a 'plain' edge (EXTERNAL or FLAT), or 'something else'. This change can make that check a single branch, i.e., instead of 'tag == EXTERNAL || tag >= FLAT', we can simply check for 'tag >= EXTERNAL'. Likewise we have some cases where we check for RING, EXTERNAL or FLAT, so we align RING + 1 with EXTERNAL.
PiperOrigin-RevId: 379291576
--
0c78e65ca4d85244b106c3f8e24cf268e09e72a3 by Benjamin Barenblat <bbaren@google.com>:
Round a double multiplication before casting it to integer
The code
static_cast<int>(x * y)
(for double x and y) performs a double multiplication into a temporary
that, by standard, may have excess precision. The subsequent cast to int
discards the excess precision. However, the cast may examine the excess
precision during conversion, producing surprising results like
static_cast<int>(1.7 * 10) == 16
on certain systems. Correct this case by explicitly rounding 1.7 * 10
before casting it.
PiperOrigin-RevId: 378922064
GitOrigin-RevId: b1fc72630aaa81c8395c3b22ba267d938fe29a2e
Change-Id: Ica708a006921118673e78d5fd2d61fe0fb0894d1
--
ca5ce10fa5286f2bfb51890a37b547308b8d6d93 by Benjamin Barenblat <bbaren@google.com>:
Skip floating-point edge-case tests when using an x87
32-bit Intel CPUs use 80-bit floats for intermediate values, which can
change the results of floating point computations from what we normally
expect. Identify tests that are sensitive to the x87, and skip them when
we’re on 32-bit Intel.
PiperOrigin-RevId: 378722613
--
e5798bb017854e7f3b6d8721fed7dd553642b83d by Abseil Team <absl-team@google.com>:
Build without -Wl,-no-undefined.
PiperOrigin-RevId: 378690619
--
3587685a2c932405e401546ec383abcfbf8495c8 by Derek Mauro <dmauro@google.com>:
Update CCTZ BUILD file.
PiperOrigin-RevId: 378688996
--
06c7841b2bf8851410b716823b7ff9b42d86085e by Derek Mauro <dmauro@google.com>:
Change the CMake install test to use installed version of GoogleTest
PiperOrigin-RevId: 378537383
--
eaa8122a7062c56bed80e806344cca0c8325bf6f by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 378525523
--
381f505cce894b8eec031a541855650c4aa46e64 by Abseil Team <absl-team@google.com>:
Mark btree_container::clear() with the ABSL_ATTRIBUTE_REINITIALIZES attribute.
This prevents false positives in the clang-tidy check bugprone-use-after-move;
it allows clear() to be called on a moved-from btree_container without any
warnings, and the btree_container will thereafter be regarded as initialized again.
PiperOrigin-RevId: 378472690
GitOrigin-RevId: ca5ce10fa5286f2bfb51890a37b547308b8d6d93
Change-Id: I4267246f418538c5baacb562d1a40213fb13f246
As of this change, you can use `-DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON` to have Abseil use the standard CMake find_package(GTest) mechanism.
--
72ce5b636488f17753d110ec18f57132d6180db3 by Derek Mauro <dmauro@google.com>:
Update GoogleTest version used by Abseil
PiperOrigin-RevId: 378296419
--
1eaa36f65315a1cb95c95dfee0bc31307d280d18 by Abseil Team <absl-team@google.com>:
Define unary + operators for absl::int128 and absl::uint128.
These are rarely used but apparently missing.
PiperOrigin-RevId: 377975179
--
1a029d6ff8f9e21ddf0b89949be04c0a56661359 by Abseil Team <absl-team@google.com>:
Remove gratuitous reinterpret_cast.
PiperOrigin-RevId: 377894806
GitOrigin-RevId: 72ce5b636488f17753d110ec18f57132d6180db3
Change-Id: I8a06f69b3489c9aef8260fd271bde2a55f01807f
--
066144400e12616f6771e512427bcd98aa203455 by Abseil Team <absl-team@google.com>:
Internal comment cleanup.
PiperOrigin-RevId: 377368470
--
3ba56d263bd90a9797d12b5ce29edce3fa65917c by Abseil Team <absl-team@google.com>:
Add tests for hash table capacity being unchanged by insert.
PiperOrigin-RevId: 377303140
GitOrigin-RevId: 066144400e12616f6771e512427bcd98aa203455
Change-Id: I2edf14b412e45a2ad490dcf9f06e009c12a60e3e
--
b2a781121ff72fb485b7e67539d5e4ff1eb66df2 by Gennadiy Rozental <rogeeff@google.com>:
Consistently use absl::flat_hash_map instead of std::map in Flags implementation.
PiperOrigin-RevId: 377132816
--
9ab83a154d8f22d51fed0092bf94245b5af1f498 by Derek Mauro <dmauro@google.com>:
Workaround for MSAN being unable to see through getentropy().
https://github.com/google/sanitizers/issues/1173
PiperOrigin-RevId: 377097059
--
8d28e921442d1b246c26f3200f21027557c47657 by Greg Falcon <gfalcon@google.com>:
Disable stack_consumption_test in tsan builds.
A recent tsan change broke the way this test-only utility was counting stack usage.
PiperOrigin-RevId: 377053169
GitOrigin-RevId: b2a781121ff72fb485b7e67539d5e4ff1eb66df2
Change-Id: Ib56356f8128f6c083f32b950091f3a56d9e2cd51
--
2c81c02d2b68303134e777f31921679ab87a2639 by Derek Mauro <dmauro@google.com>:
Use getentropy() to get seed material when using glibc >= 2.25
getentropy() uses the getrandom syscall on Linux to avoid file descriptors.
It is never interputed (EINTR) and uses the same source as /dev/urandom.
https://man7.org/linux/man-pages/man3/getentropy.3.html
getrandom has been in the Linux since kernel 3.17
When unavailable (ENOSYS), fallback to /dev/urandom.
PiperOrigin-RevId: 376962620
--
81cd41372a04eda400a2e3be53c239c0dac6bdf3 by Abseil Team <absl-team@google.com>:
Make FunctionRef no longer have -Wdeprecated-copy warnings from Clang by
defaulting the copy constructor. This is needed because the assignment
operator is deleted.
Fixes#948
PiperOrigin-RevId: 376928548
GitOrigin-RevId: 2c81c02d2b68303134e777f31921679ab87a2639
Change-Id: I0abb18052ffff5dd1448f0b68edbb668045335f0
--
cbd86b318ce206d1fe9eb001979b8d2efe57e5fa by Derek Mauro <dmauro@google.com>:
Stop inlining `CurrentThreadIdentityIfPresent()` on Apple platforms
In some build configurations the Apple linker rejects thread_local
variables exposed in headers
Fixes#954Fixes#965
PiperOrigin-RevId: 375930997
GitOrigin-RevId: e34600e09f748b686d20a4f729ae914ebfd9e7bf
Change-Id: I9fcd2f02bd6abdea3ed412217e1be18f2c7bf762
--
d74f30ef0da7139c30a24eb6c1776bc0c257e642 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 375779441
--
25e33cde30d78dbafcb81ee3ce77c3d70c74db5a by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 375520720
--
46857d17d4dbc6fbd13a27dd82e14ec814dd117a by Samuel Benzaquen <sbenza@google.com>:
Add an explicit template parameter barrier to absl::HashOf.
PiperOrigin-RevId: 375103300
--
cf2bf52b9a425b0360ed1f46778f0ef1326a3658 by Abseil Team <absl-team@google.com>:
Improve string_view API compliance with C++17 std::basic_string_view.
This adds missing overloads, default values, and constexpr specifiers.
PiperOrigin-RevId: 374885658
--
41e55166dc5bd3ed7bce567c400781585d55e1ce by Derek Mauro <dmauro@google.com>:
Update CI to GCC 11.1, Bazel 4.0.0, CMake 3.20.2, and
LLVM git:7bcc0a1e399d461af7ec013ff33bc330a2de6641
PiperOrigin-RevId: 374858288
GitOrigin-RevId: d74f30ef0da7139c30a24eb6c1776bc0c257e642
Change-Id: I657c815c83522b030495ff54ca327e7012ed151e
--
4c6405d1be98fc669b5167970783da00c6a43b86 by Derek Mauro <dmauro@google.com>:
Turn off -Warray-bounds for GCC in internal/inlined_vector.h
GCC 11 appears to erroneously warn here
PiperOrigin-RevId: 374709739
--
be9909b010b3da5967ab0ff44a09be034a1fa82f by Derek Mauro <dmauro@google.com>:
Add non-templated operator new and new[] to ThrowingValue.
GCC 11 is confused and issues -Wmismatched-new-delete.
PiperOrigin-RevId: 374648084
--
a30a87bf1498aff26bcd751daec120d14a934d99 by Derek Mauro <dmauro@google.com>:
Simplify ThrowingAllocator::select_on_container_copy_construction
to workaround what may be a clang c++20 bug
PiperOrigin-RevId: 374630576
GitOrigin-RevId: 4c6405d1be98fc669b5167970783da00c6a43b86
Change-Id: I48f1091c4a0f262961d9059dac4e6b44a82ae91d
--
30af50146f07d7afdb196abf235f44ec44ea6409 by Derek Mauro <dmauro@google.com>:
Update Abseil dependency versions
PiperOrigin-RevId: 374415690
--
6a241e9ea8ee201789bb66aadf9e1ca9cc23c5dc by Derek Mauro <dmauro@google.com>:
Fix the install test project, which is doing a mixed-mode build.
This manifests in failure with GCC 11, which defaults to C++17
Also explicitly reference python3 in the test script.
python2 is being removed by some Linux distros.
PiperOrigin-RevId: 374278107
--
42f85122407e799183880e0b2e2a71f6d35ee003 by Evan Brown <ezb@google.com>:
Use `capacity + Group::kWidth` control bytes instead of `capacity + Group::kWidth + 1`.
We don't use the extra byte - we only need the first `capacity` ones that are valid, the one sentinel byte and then `Group::kWidth - 1` cloned control bytes. For example, in `EmptyGroup()`, where capacity is 0, we use `Group::kWidth` control bytes.
We need to update set_ctrl() to only mirror `Group::kWidth - 1` bytes instead of `Group::kWidth` bytes.
Note: this doesn't actually save memory unless `alignof(value_type)` is one.
Also add/update related comments.
PiperOrigin-RevId: 374198589
--
5dcd09b2221bf23add583541769b476dac54e112 by Evan Brown <ezb@google.com>:
Improve b-tree value_comp() support.
- Don't expose internal adapted comparator functionality.
- Support value_comp() for maps using function pointer comparators.
- For maps, make value_compare's constructor and the member comparator be protected - [reference](https://en.cppreference.com/w/cpp/container/map/value_compare).
PiperOrigin-RevId: 373832649
--
d75819786ff5a06e1ed0c5c1e80b3b95ac49c83b by Evan Brown <ezb@google.com>:
Don't export adapted comparator functionality in key_comp().
PiperOrigin-RevId: 373651039
GitOrigin-RevId: 30af50146f07d7afdb196abf235f44ec44ea6409
Change-Id: I260480b0923cefeba81c543e2b7c34cacaa7d7c7
--
912c205cf80c4ed24a08000c04263403857b7f75 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 373620391
--
d454f10549d27d7b025d1ce0ef90a0cdec42c361 by Martijn Vels <mvels@google.com>:
Add SetCordRepForTesting() helper to CordzInfo
PiperOrigin-RevId: 373602832
--
7a2d7bdd2e60fb51333e81cd71ebd0a4edb60704 by Evan Brown <ezb@google.com>:
For StrAppend, make sure to follow exponential growth like std::string::append.
PiperOrigin-RevId: 373589332
--
24397f19bce45133a42feaa7c883009ef9325095 by Greg Falcon <gfalcon@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 373569246
GitOrigin-RevId: 912c205cf80c4ed24a08000c04263403857b7f75
Change-Id: I5444f7ca2c0980685ca5c51596c259b845d69673
--
9fc37c11b9e46287acef00ee06ed9adcba54dd13 by Greg Falcon <gfalcon@google.com>:
Rename absl::hash_internal::HashState to absl::hash_internal::MixingHashState.
Before this change, we had two classes named HashState: absl::HashState, the public API used for type erasure, and absl::hash_internal::HashState, the internal concrete implementation ordinarily used.
The internal class used to be named `CityHashState`, but we renamed it to `HashState` it when we changed underlying hash implementation to wyhash. This inadvertent naming conflict made the code much harder to read, and this change intends to undo that.
PiperOrigin-RevId: 373481959
--
4aec55ffddebd085c239352a2e20721091f719a1 by Greg Falcon <gfalcon@google.com>:
Introduce absl::HashOf(), a convenience wrapper around absl::Hash that calculates hashes from the values of its arguments.
PiperOrigin-RevId: 373461406
--
86b5fd8db50bbc8bd0aa9258523527381fe0445d by Abseil Team <absl-team@google.com>:
Improve speed of BlockingCounter by making its most common path lock free.
With the new implementation, the fast path of BlockingCounter::DecrementCount()
is only a fetch_sub operation. This is most times much more efficient than the
previous implementation (full mutex lock/unlock). As a matter of fact, in most
actual usecases in practice, the waiter thread is already waiting on the
Wait() call when DecrementCount() is called, which makes Mutex::Unlock() take
the slow path as there's a waiter thread that it might need to wake up.
PiperOrigin-RevId: 373394164
--
65c876be5eac0cd32583ff8535ede4109d39cf3f by Martijn Vels <mvels@google.com>:
Move the 'sample copied cord' logic into MaybeTrackCord(),
This changes move the logic for selecting if a cord should remain being sampled from Cord to CordzInfo::MaybeTrackCord, and updates the documentation for the latter method.
PiperOrigin-RevId: 373363168
--
e84410bd0aada293a81dfb82656c952e209e21fb by Martijn Vels <mvels@google.com>:
Add check for the first call to cordz_should_profile() for each thread.
This prevents the first cord of a newly created thread to be always sampled, which is a 'bad' kind of determinism for sampling.
PiperOrigin-RevId: 373229768
--
bf09c589dc099ac8f4af780bf7e609c53c27574c by Samuel Benzaquen <sbenza@google.com>:
Refactor the Flags structure into an enum.
This gives us more control over the representation and allows for easier
merging during parsing.
PiperOrigin-RevId: 373163038
--
b947b0c51083b7b6508284b5d31819596c91729e by Derek Mauro <dmauro@google.com>:
Fixes warnings about shadowed variables
Fixes#956
PiperOrigin-RevId: 373158133
GitOrigin-RevId: 9fc37c11b9e46287acef00ee06ed9adcba54dd13
Change-Id: I91f35699f9bf439d1a870c6493946a310afe088c
--
5f3c139695d5c497ca030e95a607537a7be7caa7 by Benjamin Barenblat <bbaren@google.com>:
Don’t examine irrelevant destination buckets in DiscreteDistributionTest
Abseil generates discrete distributions using Walker’s aliasing
algorithm. This creates uniformly distributed buckets, each with a
probability of sending traffic to a different bucket. Abseil represents
a bucket as a pair
(probability of retaining traffic ×
alternate bucket if traffic is passed)
and a distribution as a vector of such pairs. For example, {(0.3, 1),
(1.0, 1)} represents a distribution with two buckets, the zeroth of
which passes 70% of its traffic to bucket 1 and the first of which holds
on to all its traffic.
This representation is not unique: When a bucket retains traffic with
probability 1, the alternate bucket is irrelevant. Continuing the
example above, {(0.3, 1), (1.0, 0)} _also_ represents a two-bucket
distribution where the zeroth bucket passes 70% of its traffic to the
first and the first hangs on to all traffic. Exactly what representation
Abseil generates for a given input is related to how much precision is
used in intermediate floating-point operations, which is an
architectural implementation detail. Remove sensitivity to that detail
by not examining the alternate bucket when the retention probability is
1.0.
PiperOrigin-RevId: 372993410
--
062ac80699f748831c09a061538abffec2cdea5c by Martijn Vels <mvels@google.com>:
Avoid alredy sampled cord remaining sampled if not picked or source is sampled
PiperOrigin-RevId: 372985990
--
a9f3537e1110b7bb6450fd72a03f0c5dc6b8c89b by Evan Brown <ezb@google.com>:
Add tests for function pointer comparators, comparators that have SFINAE-visible comparison operators that are unimplemented, and for implicit construction from unadapted comparators.
PiperOrigin-RevId: 372927616
GitOrigin-RevId: 5f3c139695d5c497ca030e95a607537a7be7caa7
Change-Id: I996a8452e7bd88f9dd2e59633b01bbc09f42620d
--
51e9291d9bc385082b4061fe760b236ba59c79c3 by Abseil Team <absl-team@google.com>:
Cast to uint64_t using braces instead of parentheses.
PiperOrigin-RevId: 372475909
--
939fc409855da2639dcaf2d1d4971ca0e0568d03 by Martijn Vels <mvels@google.com>:
Expand # flat nodes into size detailed counters.
PiperOrigin-RevId: 372474608
--
54b158c99b32f8a14821ce74fed0f9f836525ce7 by Martijn Vels <mvels@google.com>:
Make copies of sampled cords sampled as well
This applies to the following methods:
- Cord(const Cord&)
- operator=(const Cord&)
- Subcord(...)
PiperOrigin-RevId: 372468160
--
876c2581ce008871464e8b471efbb967d150f83b by Andy Getzendanner <durandal@google.com>:
Document the type of an ABSL_FLAGS.OnUpdate() callback.
PiperOrigin-RevId: 372406390
GitOrigin-RevId: 51e9291d9bc385082b4061fe760b236ba59c79c3
Change-Id: Ifb75122cae56b66c28128aee90a63bbb28d93817
--
daf5a2b9ab3507ad5fb9aebe9165933f33098b83 by Abseil Team <absl-team@google.com>:
Absl flat containers reserve enough space even in the presence of tombstones.
PiperOrigin-RevId: 372339945
--
9a61504867ba0eccc5046d7333090fbe3439cdd9 by Abseil Team <absl-team@google.com>:
Add benchmark for BlockingCounter
PiperOrigin-RevId: 372246068
--
91ee87e6de09fc62970667ee52654c9dcf7c478d by Evan Brown <ezb@google.com>:
In absl::StrSplit, support btree_multimap, and other non-std::multimap-multimaps by supporting any map type that returns iterator from insert().
Also:
- Use emplace() instead of insert() when available, not just for std::(multi)map - we can potentially change some string copies to moves this way.
- We no longer need the Insert class so remove it.
PiperOrigin-RevId: 372209653
GitOrigin-RevId: daf5a2b9ab3507ad5fb9aebe9165933f33098b83
Change-Id: I83098fde4a722cd4b682f024d3bfa56c613f960c
--
5d6734366ec54997df5234ac3b7e21015d7d5fde by Martijn Vels <mvels@google.com>:
Increase slop for unit test to reduce flakiness of test
PiperOrigin-RevId: 371935786
--
6e97ff23e7f732ebf969bbc69102e5e677aae8cd by Martijn Vels <mvels@google.com>:
Add node and memory usage stats analysis to GetCordzStatistics.
PiperOrigin-RevId: 371893353
--
17f7443e6f988f25efa25c2291c1cde191af2bf2 by Martijn Vels <mvels@google.com>:
Add check on n == 0 in CordReader::ReadCord, which breaks invariants in the ring buffer code.
PiperOrigin-RevId: 371738207
GitOrigin-RevId: 5d6734366ec54997df5234ac3b7e21015d7d5fde
Change-Id: I0fc883f4f49f2380ab9afddbdfe6eb5ccc15dfc3
--
cf88f9cf40eab54c06bca7f20795352ec23bb583 by Derek Mauro <dmauro@google.com>:
Fixes build with latest glibc
Fixes#952
PiperOrigin-RevId: 371693908
--
99bcd0f4a747ce7a401e23c745adf34d0ec5131b by Samuel Benzaquen <sbenza@google.com>:
Add support for std::string_view in StrFormat even when
absl::string_view != std::string_view.
PiperOrigin-RevId: 371693633
--
e35463572149a6c2d4a0d439b9300ce03fd6b96d by Abseil Team <absl-team@google.com>:
Cmake builds should only install pkg-config when explicitly requested.
PiperOrigin-RevId: 371403419
GitOrigin-RevId: cf88f9cf40eab54c06bca7f20795352ec23bb583
Change-Id: I4360a18c638a4d901ff44ab1e0a9d8f321c302ea
--
60b8e77be4bab1bbd3b4c3b70054879229634511 by Derek Mauro <dmauro@google.com>:
Use _MSVC_LANG for some C++ dialect checks since MSVC doesn't
set __cplusplus accurately by default.
https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
See GitHub #722.
PiperOrigin-RevId: 371362181
--
5d736accdff04db0e722f377c0d79f2d3ed53263 by Martijn Vels <mvels@google.com>:
Fix the estimated memory size for CordRepExternal
PiperOrigin-RevId: 371350380
--
eaaa1d8a167aeca67a2aa3a098a2b61a9d72172f by Martijn Vels <mvels@google.com>:
Remove flakes by not enforcing re-allocated pointers do never match original
Tests that do multiple updates could end up with the original allocated pointer on a 2nd resize, so the 'EqIfPrivate' should not assume that if we do 'not' have the capacity that all following relocations will never match the original. We only care about 'pointer unchanged if private and there is capacity', trying to establish 'pointer changed at some point due to re-allocation; is pointless.
PiperOrigin-RevId: 371338965
--
d1837bee6bade1902b095c1cbf64231668bb84c5 by Martijn Vels <mvels@google.com>:
Undo inline of small data copy in cord
This leads to a performance regression as the code is not inlined (absent hard FDO inputs), and there are no suitable tail call options.
PiperOrigin-RevId: 371332332
--
06dc64b833069efc7d18b11df607c8c22be690da by Martijn Vels <mvels@google.com>:
Add final instrumentation for Cordz and remove 'old' cordz logic.
This change instruments the last cord function for cordz. It removes the 'old' functions: set_tree, replace_tree, UpdateCordzStatistics and RecordMetrics.
PiperOrigin-RevId: 371219909
--
a5e0be538579c603052feec03e6d9910c43ea787 by Martijn Vels <mvels@google.com>:
Extend the life of CordRep* if inside a snapshot
If a snapshot (potentially) includes the current CordzInfo, we need to extent the lifetime of the CordRep*, as the snapshot 'point in time' observation of the cord should ideally be preserved.
PiperOrigin-RevId: 371146151
--
74d77a89774cd6c8ecdeebee0193b294a39383d6 by Martijn Vels <mvels@google.com>:
Instrument std::string consuming methods: ctor, operator=, Append and Prepend
This change moves the 'steal into CordRep' logic into a separate function so we can use it directly in the ctor, operator assign and append and prepend, allowing Cordz instrumentation with the proper method attributes.
The assign operator is implemented in AssignLargeString leaving the dispatch inlined in cord.h (which as a side effects also allows clean tail calls in the AssignLargeString method)
PiperOrigin-RevId: 371094756
--
b39effc45266b7ce2e7f96caa3b16cb6e3acc2dd by Martijn Vels <mvels@google.com>:
Add Cordz instrumentation to CordReader
PiperOrigin-RevId: 370990181
GitOrigin-RevId: 60b8e77be4bab1bbd3b4c3b70054879229634511
Change-Id: I96af62e6f1a643e8b1228ae01e6c84e33706bb05
--
f6fbb03bff276e72123e8590519079e87732ae62 by Abseil Team <absl-team@google.com>:
Replace static absl::Mutex with SpinLock in absl::Cords
to avoid static initializers by absl::Mutex destructors
PiperOrigin-RevId: 370694199
--
654b7d9edfdc24f226990b2b46cbf91451a1d92a by Martijn Vels <mvels@google.com>:
Implement global data for CordzInfo in an ODR hardened way
This change puts the global data into a global list structure, and stores a reference to the global list in the handle itself. This hardens the implementation against ODR violations where info pointers are crossing dynamic library boundaries which are privately loaded.
PiperOrigin-RevId: 370673045
--
712dba768e66ee2ba85d6010829c617cd2af6ba7 by Martijn Vels <mvels@google.com>:
Intrument Cord::operator= for Cordz
PiperOrigin-RevId: 370659149
--
c0b347a2289e151b72680269332e264b8fa989c0 by Matt Kulukundis <kfm@google.com>:
Fix test guards for ABSL_ATTRIBUTE_RETURNS_NONNULL
PiperOrigin-RevId: 370594807
--
c2bedaa3472ef223f907de2604f9b9b58852ec5f by Martijn Vels <mvels@google.com>:
Add new Cordz instrumentation on GetAppendRegion.
PiperOrigin-RevId: 370587761
--
84fbfcc852697d509f6094482b86e84743a6b331 by Martijn Vels <mvels@google.com>:
Add instrumentation on Cord::Apppend(string_view)
PiperOrigin-RevId: 370576590
--
9e077390b8ca2239e1cb7bfbe1d5a04f2fc11d30 by Abseil Team <absl-team@google.com>:
Google-internal changes only.
PiperOrigin-RevId: 370558424
--
fb53c149eb2364ea34e3a67235f873866618b8ac by Matt Kulukundis <kfm@google.com>:
Update config.h macros with a few useful helpers to simplify version checking
PiperOrigin-RevId: 370557684
--
abf8142e99b9ff7e15f6528a357f1005461950b0 by Martijn Vels <mvels@google.com>:
clang-format cord
PiperOrigin-RevId: 370549371
--
e555985eabe63fcf0e980e9c433dd84caffec191 by Martijn Vels <mvels@google.com>:
Add MaybeUntrackCord() function
This function is near identical to the old UntrackCord() but allows info to be null, moving the cord.is_profiled() branch into CordzInfo.
PiperOrigin-RevId: 370528447
--
3883538efe4601f7864bda70a50d868bb383c63b by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 370503186
--
a9514b65542fde1bc73584e6f3c1c4b3a05f215f by Derek Mauro <dmauro@google.com>:
Add -Winvalid-constexpr to warning options for LLVM
PiperOrigin-RevId: 370455171
--
d8a3966de2cf15a2dc28e17e49a3d27d205eca92 by Martijn Vels <mvels@google.com>:
Add naive UniqueGenerator<T, kMaxValues, ...> to avoid flakes from dup random values.
PiperOrigin-RevId: 370179772
--
46d0caa1a12b68a5998d4f919e20f0f83b9286f8 by Martijn Vels <mvels@google.com>:
Add new Cordz instrumentation on PrependTree.
PiperOrigin-RevId: 370138969
GitOrigin-RevId: f6fbb03bff276e72123e8590519079e87732ae62
Change-Id: Ifa4c00a5c7b01198ee367a3253bea6b66612135e
--
f825cf3feb6db06522b2b4ee785de7dfa325780d by Martijn Vels <mvels@google.com>:
Move Cordz test helpers to cordz_test_helpers library
PiperOrigin-RevId: 370059941
--
5080249da6a4f5cc2b546aed48503fd028670379 by Martijn Vels <mvels@google.com>:
Add new Cordz instrumentation on AppendTree.
PiperOrigin-RevId: 369968167
--
21092b889fad34ec605894e311b436d5f417456f by Benjamin Barenblat <bbaren@google.com>:
Round floats using round(x), not static_cast<int>(x + 0.5)
Adding 0.5 to an IEEE float may cause one bit of precision loss, which
is enough to change the result in certain cases. For example,
static_cast<int>(std::round(0.49999999999999994)) == 0
static_cast<int>(0.49999999999999994 + 0.5) == 1
PiperOrigin-RevId: 369926519
GitOrigin-RevId: f825cf3feb6db06522b2b4ee785de7dfa325780d
Change-Id: Ib78ce1faec79f06578933db5dc6fc05de043ead1
--
9e0df3dd23da17cd0ff75c93c1493a858032639c by Martijn Vels <mvels@google.com>:
Prep work for changing Cordz instrumentation
Create CordzInfo::TrackCord() and CordzInfo::MaybeTrackCord() methods on InlineData
This follows a suggestion from kfm@ to move where possible Cordz logic out of Cord and Cord::InlineRep, which we can now that InlineData provides us the abstraction of Cords internal data.
PiperOrigin-RevId: 369844310
--
45f39709033bd3bc09fa1a7880a5b3c9eaa617c7 by Abseil Team <absl-team@google.com>:
Fix dependence on C++20 constexpr default construction of std::atomic.
PiperOrigin-RevId: 369745251
--
195ae230963c95068406ab0e73b4e711b5f3cd62 by Martijn Vels <mvels@google.com>:
Reduce the cost of 'SetCordRep()`
This change inlines SetCordRep(), which is currently two stores and a branch, going forward a naked store. AssertHeld is only enforced for debug builds.
The intention here is not to reduce the 'actual' (or 'self') cost of SetCordRep() as it should only be called for sampled cords, but to reduce the cost of a branch and out of line call at the call site. The compiler can now 'perfectly inline' the single branch / store.
PiperOrigin-RevId: 369696265
--
d722199ed69d413994740624159ac7bd001a9219 by Martijn Vels <mvels@google.com>:
Add kDefaultInit initialization
This avoids double store on init
PiperOrigin-RevId: 369655217
--
3499aed79e6cc12ce36277063ec37991bba0cccd by Martijn Vels <mvels@google.com>:
Introduce CordzUpdateScope
PiperOrigin-RevId: 369491326
--
325c1bc99c7d1aeca7bd1273e51a0900b6faf731 by Abseil Team <absl-team@google.com>:
make unary and logical operators constexpr
PiperOrigin-RevId: 369476773
--
ad3bed3dea5e5d7d281ff36ee786f802630c3728 by Martijn Vels <mvels@google.com>:
Add LOCKABLE attribute to CordzInfo
PiperOrigin-RevId: 369476772
GitOrigin-RevId: 9e0df3dd23da17cd0ff75c93c1493a858032639c
Change-Id: I00e2859328fe8da46d2e04d3f07dfe70ec6cb1f5
--
ac1df60490c9583e475e22de7adfc40023196fbf by Martijn Vels <mvels@google.com>:
Change Cord constructor(string_view) to explicit make_tree and Cordz tracking
This CL changes the ctor to use an easier to maintain model where Cord code explicitly invokes Cordz update or new / tree logic, which avoids the ambiguity of the 'branched' InlineRep::set_tree code. This removes the need to equip InlineRep with 'MethodIdentifier' or other necessary call info, and also is a cleaner model: InlineRep is carrying too much code now that should plainly sit in Cord, especially with all internal abstractions having moved to InlineData.
See child CL(s) for desired state
PiperOrigin-RevId: 369433619
--
b665af7f586e6c679a8b27d4f78d5a1d2b596058 by Abseil Team <absl-team@google.com>:
Rename the 'Compare' template type to 'LessThan', as the passed-in function is expected to act like operator<. It is worth avoiding confusion with std::compare, which returns an int (-1/0/1), as due to implicit casting this can lead to hard-to-spot bugs.
PiperOrigin-RevId: 369391118
--
c3c775269cad0f4982ec63f3616dd78bb9e52dca by Martijn Vels <mvels@google.com>:
Integrate CordzUpdateTracker into CordzInfo
PiperOrigin-RevId: 369348824
--
771d81ed357496c117179e1daec76eba5155932d by Martijn Vels <mvels@google.com>:
Replace mutex() with Lock() / Unlock() function
Mini design future tracking of CordzInfo sampled cords: CordzInfo holds a CordRep* reference without a reference count. Cord is responsible for synchronizing updates for sampled cords such that the CordRep* contained in CordzInfo is at all times valid. This is done by scoping Lock() and Unlock() calls around the code modifying the code of a sampled cord. For example (using the future CL CordzUpdateScope()):
CordzInfo* cordz_info = get_cordz_info();
CordzUpdateScope scope(cordz_info, CordzUpdateTracker::kRemovePrefix);
CordRep* rep = RemovePrefixImpl(root);
set_tree(rep);
if (cordz_info) {
cordz_info->SetCordRep(rep);
}
On CordzInfo::Unlock(), if the internal rep is null, the cord is no longer sampled, and CordzInfo will be deleted. Thus any update resulting in the Cord being inlined will automatically no longer be sampled.
PiperOrigin-RevId: 369338802
--
5563c12df04a1e965a03b50bdd032739c55c0706 by Martijn Vels <mvels@google.com>:
Add UpdateTracker to CordzStatistics
PiperOrigin-RevId: 369318178
--
6b4d8463722a3e55a3e8f6cb3741a41055e7f83e by Martijn Vels <mvels@google.com>:
Add kClear, kConstructor* and kUnknown values and fix typo
PiperOrigin-RevId: 369297163
--
041adcbc929789d6d53371a8236840fc350e1eeb by Derek Mauro <dmauro@google.com>:
Switch from malloc to operator new in pool_urbg.cc
so it can only fail by throwing/aborting
PiperOrigin-RevId: 369274087
--
5d97a5f43e3f2d02d0a5bbe586d93b5751812981 by Benjamin Barenblat <bbaren@google.com>:
Correct Thumb function bound computation in the symbolizer
On 32-bit ARM, all functions are aligned to multiples of two bytes, and
the lowest-order bit in a function’s address is ignored by the CPU when
computing branch targets. That bit is still present in instructions and
ELF symbol tables, though; it’s repurposed to indicate whether the
function contains ARM or Thumb code. If the symbolizer doesn’t ignore
that bit, it will believe Thumb functions have boundaries that are off
by one byte, so instruct the symbolizer to null out the lowest-order bit
after retrieving it from the symbol table.
PiperOrigin-RevId: 369254082
--
462bb307c6cc332c1e2c3adb5f0cad51804bf937 by Derek Mauro <dmauro@google.com>:
Add a check for malloc failure in pool_urbg.cc
GitHub #940
PiperOrigin-RevId: 369238100
GitOrigin-RevId: ac1df60490c9583e475e22de7adfc40023196fbf
Change-Id: Ic6ec91c62cd3a0031f6a75a43a83da959ece2d25
--
c7ce91501834b225bc9cf2d3fa2a319dd0b7f864 by Martijn Vels <mvels@google.com>:
Implement global data for CordzHandle in an ODR hardened way
This change puts the global data into a global delete queue structure, and stores a reference to the global data in the handle itself. This hardens the implementation against ODR violations where handles are crossing dynamic library boundaries which are privately loaded.
PiperOrigin-RevId: 368885636
GitOrigin-RevId: c7ce91501834b225bc9cf2d3fa2a319dd0b7f864
Change-Id: I9775151a760b30989dec9517e4bcd2183e8c1651
--
341670bce317dd6af8d3c066970230591a47e80c by Martijn Vels <mvels@google.com>:
Change GetStack() and GetParentStack() to return absl::Span
PiperOrigin-RevId: 368765721
--
6aaab9536d6957303c7aba100c3afaa6fb0ea2c8 by Martijn Vels <mvels@google.com>:
Remove locking from parent stack.
This change removes the need to lock all access to `parent_stack' by making the 'copy constructor' logic specify the 'copied from' CordzInfo (where available) to the TrackCord function, after which parent_stack is immutable.
PiperOrigin-RevId: 368760630
--
b19e2059cada35a8ede994833018edac94de6ddc by Martijn Vels <mvels@google.com>:
Add cordz instrumentation to Cord
PiperOrigin-RevId: 368746225
--
67b8bbf980f0f4e1db79aa32968e9a715a09b51a by Martijn Vels <mvels@google.com>:
Create ABSL_INTERNAL_CORDZ_ENABLED define controlling when Cordz code is enabled
There are specific builds and condtions under which we don't support cordz sampling, which is per this change represented by ABSL_INTERNAL_CORDZ_ENABLED being defined.
PiperOrigin-RevId: 368731603
--
8cbfe0e3169637a620f4b66ad2bc2ce340879cb0 by Martijn Vels <mvels@google.com>:
Add a `rep` property to CordzInfo to be managed by Cord logic.
This change adds a `rep` property to CordzInfo, which is intended to be used by collection logic.
Mini design:
Cord invokes TrackCord() providing the active 'root' cordrep of the newly sampled Cord, returning a CordzInfo with a weak (uncounted) reference to this root. Cord invokes `SetCordRep()` each time the root cordrep of the sampled Cord is updated while holding `mutex()`. Cord must also obtain `mutex()` _before_ removing a reference on the old root. i.e.: Cord must guarantee that the (weak) reference held in CordzInfo is at all times valid.
CordzInfo collection code can then safely obtain a (reference counted) rep pointer by adding a reference to `rep_` while holding `mutex()`. This requires only a very brief critical section inside CordzInfo logic, minimizing contention with concurrent Cord updates.
Cord code should typically obtain and hold `mutex()` for the entirety of each mutating Cord operation on a sampled cord. As Cord is thread compatible, it never competes on the lock with any other thread. The only possible concurrent access is from Cordz collection code, which should be a relatively rare event.
PiperOrigin-RevId: 368673758
--
1255120dce2bdd6b4205a34a0e555e0b74b6152f by Martijn Vels <mvels@google.com>:
Remove 'depth' from active recorded metrics.
Going forward we do not 'live' record depth (and size), but will observe these at collection time only.
PiperOrigin-RevId: 368636572
--
83e5146e35f221736b49e9f0a8805f8c159a51db by Martijn Vels <mvels@google.com>:
Make cordz targets visible in OSS
PiperOrigin-RevId: 368615010
--
dcb16a4f1239151f0a8c70a8cfeb29dabbd113b8 by Martijn Vels <mvels@google.com>:
Internal cleanup
PiperOrigin-RevId: 368514666
GitOrigin-RevId: 341670bce317dd6af8d3c066970230591a47e80c
Change-Id: I94cecfbbd441eb386f99fc5186c468a7a5538862
--
5ff0c4b38386ae80b25e9f8d0e1bac07fd7ce92c by Martijn Vels <mvels@google.com>:
Add CordzUpdateTracker class
PiperOrigin-RevId: 368469046
--
4de916b1ba4b5480b4dbe93d28c5eaa110449c66 by Derek Mauro <dmauro@google.com>:
Adds `ABSL_ATTRIBUTE_LIFETIME_BOUND` to `absl::Span`s initializer_list
constructor.
Compilers that support this attribute will emit a warning
if the parameter does not have sufficient lifetime.
For more information, see
b97a1ecda8/absl/types/span.h (L209-L248)
PiperOrigin-RevId: 368429085
--
bb6669016412bf5afffc02d0818a66dfe1c524cf by Martijn Vels <mvels@google.com>:
Reorganize internal cord code in CMakeLists.txt into cord_internal library
PiperOrigin-RevId: 368423765
--
d1d7fce066172d5fcfa0310c4e27631d895d7e50 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 368346725
GitOrigin-RevId: 5ff0c4b38386ae80b25e9f8d0e1bac07fd7ce92c
Change-Id: Ic4627eab4f0274e400a6d12cde3341fb538de075