This is an immutable view type, and the viewed data have a very limited lifetime. Since it's immutable and has no public constructor, there's no way to repoint one at a longer-lived copy of the data.
PiperOrigin-RevId: 479089273
Change-Id: I2ea70878edc45fa1774c8fd26dee3a1b726d8b4a
Such sinks must define ADL-callable `AbslFormatFlush()`. It can just forward to
`Append()`.
PiperOrigin-RevId: 479043790
Change-Id: I5d7d80ca1e17adf03b77726df8a52e2b4e9196ce
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
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
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
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
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
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
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
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