diff options
Diffstat (limited to 'absl/strings/cord.h')
-rw-r--r-- | absl/strings/cord.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/absl/strings/cord.h b/absl/strings/cord.h index 3f0633bd..662e889a 100644 --- a/absl/strings/cord.h +++ b/absl/strings/cord.h @@ -855,6 +855,11 @@ class Cord { // Returns true if the Cord is being profiled by cordz. bool is_profiled() const { return data_.is_tree() && data_.is_profiled(); } + // Returns the available inlined capacity, or 0 if is_tree() == true. + size_t inline_capacity() const { + return data_.is_tree() ? 0 : kMaxInline - data_.inline_size(); + } + // Returns the profiled CordzInfo, or nullptr if not sampled. absl::cord_internal::CordzInfo* cordz_info() const { return data_.cordz_info(); |