If a user-defined type has `AbslStringify()` defined, it will always be used for logging over `operator<<`.
`HasAbslStringify` now uses the empty class `UnimplementedSink` for its checks instead of `StringifySink` in order to make it work in cases involving other sinks.
PiperOrigin-RevId: 485710377
Change-Id: Ibdd916151c7abc3269c35fbe79b772867f3d25e1
- Separate the failure cases into different assertions: end/default constructed vs rehashed or erased.
- Update the assertion error for AssertIsValid to not mention the end iterator case because end iterators are considered valid by AssertIsValid.
- Also fix an out-of-date comment for skip_empty_or_deleted.
PiperOrigin-RevId: 485402559
Change-Id: I593056abdc6c3565d0396fb885923fef643bf4e4
In a previous change, I forgot to fix the DLLs to
also set the target_compile_features() as needed.
Some amount of refactoring to expose the necessary
variables and functions in AbseilDll.cmake
Fixes#1116
PiperOrigin-RevId: 485101834
Change-Id: I5cd0eff9e20c0ddf48c364f917e40d66df0aac17
This function is unnecessary as it was originally used to support modifiers with `absl::StrFormat()`. This functionality is irrelevant to `absl::StrCat()`.
PiperOrigin-RevId: 484339246
Change-Id: I8c4a0ee01b30aee7a83f6ab54e5465465cc9cc56
ABSL_RANDOM_RANDEN_COPTS
Everything works fine when this is empty
Fixes#1301
PiperOrigin-RevId: 484014466
Change-Id: I2fa96d845320f23063e1e86ee2df3ac14bd44012
- Check for invalid generation before checking for other types of invalid iterators.
- Check specifically for dereferencing end() iterators.
PiperOrigin-RevId: 483725646
Change-Id: Ibca19c48b1b242384683580145be8fb9ae707bc8
On single-core systems, a thread could be preempted while holding an
absl::Mutex, or even worse, the spin lock. If a FIFO thread wakes up and
tries to acquire this lock, it might not be able to yield() to the sleeping
thread.
Within MutexDelay(), a yield() and a sleep(10us) are used to yield the CPU.
The yield() would do nothing if the calling thread holds the highest
priority in the system. The 10us sleep() may not be able to reach the
scheduler either, if the system is slow enough.
This code path is known to be reachable in the following scenarios:
- a FIFO thread calls LockSlowLoop() with spin lock held by a normal thread
- a FIFO thread calls LockWhen*() with the Mutex held by a normal thread for a long time
- a FIFO thread calls Await*(), releases the Mutex to be held by a normal thread for a long time
This CL adds a mutex global for the sleep time, and sets it using the
return time of the a yield() call. Yield() must reach the
scheduler even when it fails to yield to anyone, and would allow sleep() to do the
same. A small constant multiplier (5) is also applied to overcome uncontrollable
factors in the runtime and help sleep() to consistently yield to another thread.
Upper and lower bounds for the sleep time is also controlled to block any unreasonable values.
PiperOrigin-RevId: 483459711
Change-Id: I14efadbadaf9244a2462f377b515147bda651c89
The SetLogtostderr and SetAlsologtostderr tests are setting flags that cause the stderrthreshold global value to be out of sync with the stderrthreshold flag. As a result, it is not currently possible to remove order dependency with these existing tests.
PiperOrigin-RevId: 481731395
Change-Id: Ie992520982f2e69821d1d1b660e3326bf745ef0d
Note: btree_iterator::operator- is still O(N) because in the worst case (end()-begin()), we will have at least one operation per node in the tree, and there are at least N/M nodes, where M (a constant) is the maximum number of values per node.
PiperOrigin-RevId: 481716874
Change-Id: Ic0225b7509208ed96b75a2dc626d2aa4a24f4946
We are also moving some internals into an internal header.
`HasAbslStringify` was not previously in an internal namespace but was intended
to be and has now been moved to an internal namespace. This is in adherence to
our compatibility guidelines which wave requirements for APIs within their
first 30 days of public release (See https://abseil.io/about/compatibility for
details).
PiperOrigin-RevId: 481190705
Change-Id: I4c0c348f269ea8d76ea3d4bd5a2c41cce475dc04
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 enables these warnings and fixes the remaining known issues.)
Bug: chromium:1292951
PiperOrigin-RevId: 480981210
Change-Id: I92d5023c6833e24d6aa29b10d433116329972f41
This moves inlined code around a bit without changing anything bar the names of things. The purpose for all this is that it greatly simplifies the process of adding memory poisining to Cord / InlineData. InlineData can have scoped poison / unpoison regions around the interface, calling into rep for the 'real code'. I.e.:
Rep::as_chars() { return &inline_data[1]; }
InlineData::as_chars() {
Unpoisoned self(this);
return rep_.as_chars();
}
Likewise, it greatly simplifies intercepting the code for constructors, copy constructors and operator= logic.
PiperOrigin-RevId: 480893031
Change-Id: I050c88caff2315939d95a0361ae20528be36a96b
Those have been exported by accident and are using internal machinery to
implement verbose logging.
PiperOrigin-RevId: 480815356
Change-Id: I84f6b6dac562cb27634d6538023eda66bed9a7f8
checking but can happen for incorrect formats parsed via ParsedFormat::New.
Specifically, if a user were to add length modifiers with 'v', for example the
incorrect format string "%hv", the ParsedFormat would incorrectly be allowed.
PiperOrigin-RevId: 480183817
Change-Id: I8510c13189fdf807cdaa7f2e1b7ed9fba2aaefb9