summaryrefslogtreecommitdiff
path: root/absl/strings/internal/cord_internal.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-11-19 10:46:01 -0800
committerGravatar dinord <dino.radakovich@gmail.com>2021-11-19 14:24:39 -0500
commit72c765111173a61de6e4184bb837f855b7869952 (patch)
tree4dbbe8c6536828d6d86dc6b43b3d5b9e3a06bdf1 /absl/strings/internal/cord_internal.h
parent8a4e6b8cc9baa26ebdc87fd813dc808d77e0640c (diff)
Export of internal Abseil changes
-- 28ba85cbeb766341969fda677bbd8df8615b349f by Martijn Vels <mvels@google.com>: Internally allow for CordRepFlat sizes up to 256KB The default flat size will remain at 4KB, but this allows for future specializations such as file io and compression where larger buffers can be used providing 'zero copy' streaming optimizations. PiperOrigin-RevId: 411095538 -- 0c1cae5ff376a0955a5b67868723836665737801 by Abseil Team <absl-team@google.com>: cord_rep_btree: Reduce nesting in `DestroyTree` using guard clauses PiperOrigin-RevId: 411093741 GitOrigin-RevId: 28ba85cbeb766341969fda677bbd8df8615b349f Change-Id: Ieb84ed409f1e8a8bca74edebbf2d097a9ec828a7
Diffstat (limited to 'absl/strings/internal/cord_internal.h')
-rw-r--r--absl/strings/internal/cord_internal.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/absl/strings/internal/cord_internal.h b/absl/strings/internal/cord_internal.h
index 672bf178..b16c8fa5 100644
--- a/absl/strings/internal/cord_internal.h
+++ b/absl/strings/internal/cord_internal.h
@@ -185,13 +185,16 @@ enum CordRepKind {
EXTERNAL = 5,
// We have different tags for different sized flat arrays,
- // 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).
+ // starting with FLAT, and limited to MAX_FLAT_TAG. The below values map to an
+ // allocated range of 32 bytes to 256 KB. The current granularity is:
+ // - 8 byte granularity for flat sizes in [32 - 512]
+ // - 64 byte granularity for flat sizes in (512 - 8KiB]
+ // - 4KiB byte granularity for flat sizes in (8KiB, 256 KiB]
+ // If a new tag is needed in the future, then 'FLAT' and 'MAX_FLAT_TAG' should
+ // be adjusted as well as the Tag <---> Size mapping logic so that FLAT still
+ // represents the minimum flat allocation size. (32 bytes as of now).
FLAT = 6,
- MAX_FLAT_TAG = 226
+ MAX_FLAT_TAG = 248
};
// There are various locations where we want to check if some rep is a 'plain'