diff options
author | Abseil Team <absl-team@google.com> | 2021-11-04 14:12:39 -0700 |
---|---|---|
committer | vslashg <gfalcon@google.com> | 2021-11-04 20:05:58 -0400 |
commit | c86347d4cec43074e64e225a8753728f4bfc5ed6 (patch) | |
tree | b8d87f1029aefaa6eb71e21fdddfb9a2a59f3849 /absl/strings/internal/cord_internal.h | |
parent | d6c75d9dd895922bf5dc6c38245ac8887d3e68fc (diff) | |
download | abseil-c86347d4cec43074e64e225a8753728f4bfc5ed6.tar.gz abseil-c86347d4cec43074e64e225a8753728f4bfc5ed6.tar.bz2 abseil-c86347d4cec43074e64e225a8753728f4bfc5ed6.zip |
Export of internal Abseil changes
--
5e45aadfb89e366dedd1fcad5034a76c5c10ad76 by James Y Knight <jyknight@google.com>:
Correct the conditions for std::{optional,variant,any} availability on Apple platforms.
Before XCode 12.5, the availability declarations incorrectly excluded one release on which the features were in fact available. This was corrected in https://github.com/llvm/llvm-project/commit/7fb40e1569dd66292b647f4501b85517e9247953
Unfortunately, we cannot simply switch abseil to the corrected versions, as that will cause build failures when using the older XCode toolchain. So, we check the version, and choose the correct set of versions for the toolchain in use.
PiperOrigin-RevId: 407667302
--
376fa06cde048e536e9447336b27bebf598ed4ea by Greg Falcon <gfalcon@google.com>:
Cord implementation change: Add a new CordRepCrc node type.
This is an implementation detail that will allow storing expected CRCs alongside cord data. This node is intended only to live at the top of Cord trees.
PiperOrigin-RevId: 407587140
GitOrigin-RevId: 5e45aadfb89e366dedd1fcad5034a76c5c10ad76
Change-Id: Iea3ca001c0cbb4deec8286b5581b30dc172a9918
Diffstat (limited to 'absl/strings/internal/cord_internal.h')
-rw-r--r-- | absl/strings/internal/cord_internal.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/absl/strings/internal/cord_internal.h b/absl/strings/internal/cord_internal.h index bfe5564e..bf135ae2 100644 --- a/absl/strings/internal/cord_internal.h +++ b/absl/strings/internal/cord_internal.h @@ -192,6 +192,7 @@ struct CordRepConcat; struct CordRepExternal; struct CordRepFlat; struct CordRepSubstring; +struct CordRepCrc; class CordRepRing; class CordRepBtree; @@ -199,18 +200,19 @@ class CordRepBtree; enum CordRepKind { CONCAT = 0, SUBSTRING = 1, - BTREE = 2, - RING = 3, - EXTERNAL = 4, + CRC = 2, + BTREE = 3, + RING = 4, + EXTERNAL = 5, // We have different tags for different sized flat arrays, - // starting with FLAT, and limited to MAX_FLAT_TAG. The 225 value is based on + // starting with FLAT, and limited to MAX_FLAT_TAG. The 226 value is based on // the current 'size to tag' encoding of 8 / 32 bytes. If a new tag is needed // in the future, then 'FLAT' and 'MAX_FLAT_TAG' should be adjusted as well // as the Tag <---> Size logic so that FLAT stil represents the minimum flat // allocation size. (32 bytes as of now). - FLAT = 5, - MAX_FLAT_TAG = 225 + FLAT = 6, + MAX_FLAT_TAG = 226 }; // There are various locations where we want to check if some rep is a 'plain' @@ -251,6 +253,7 @@ struct CordRep { constexpr bool IsRing() const { return tag == RING; } constexpr bool IsConcat() const { return tag == CONCAT; } constexpr bool IsSubstring() const { return tag == SUBSTRING; } + constexpr bool IsCrc() const { return tag == CRC; } constexpr bool IsExternal() const { return tag == EXTERNAL; } constexpr bool IsFlat() const { return tag >= FLAT; } constexpr bool IsBtree() const { return tag == BTREE; } @@ -261,6 +264,8 @@ struct CordRep { inline const CordRepConcat* concat() const; inline CordRepSubstring* substring(); inline const CordRepSubstring* substring() const; + inline CordRepCrc* crc(); + inline const CordRepCrc* crc() const; inline CordRepExternal* external(); inline const CordRepExternal* external() const; inline CordRepFlat* flat(); |