abseil-cpp/absl/strings/cord.cc
Go to the documentation of this file.
1 // Copyright 2020 The Abseil Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "absl/strings/cord.h"
16 
17 #include <algorithm>
18 #include <atomic>
19 #include <cstddef>
20 #include <cstdio>
21 #include <cstdlib>
22 #include <iomanip>
23 #include <iostream>
24 #include <limits>
25 #include <ostream>
26 #include <sstream>
27 #include <type_traits>
28 #include <unordered_set>
29 #include <vector>
30 
31 #include "absl/base/casts.h"
32 #include "absl/base/internal/raw_logging.h"
33 #include "absl/base/macros.h"
34 #include "absl/base/port.h"
35 #include "absl/container/fixed_array.h"
36 #include "absl/container/inlined_vector.h"
38 #include "absl/strings/escaping.h"
40 #include "absl/strings/internal/cord_internal.h"
43 #include "absl/strings/internal/cord_rep_flat.h"
44 #include "absl/strings/internal/cordz_statistics.h"
45 #include "absl/strings/internal/cordz_update_scope.h"
46 #include "absl/strings/internal/cordz_update_tracker.h"
47 #include "absl/strings/internal/resize_uninitialized.h"
48 #include "absl/strings/str_cat.h"
49 #include "absl/strings/str_format.h"
50 #include "absl/strings/str_join.h"
51 #include "absl/strings/string_view.h"
52 
53 namespace absl {
55 
56 using ::absl::cord_internal::CordRep;
57 using ::absl::cord_internal::CordRepBtree;
58 using ::absl::cord_internal::CordRepCrc;
59 using ::absl::cord_internal::CordRepExternal;
60 using ::absl::cord_internal::CordRepFlat;
61 using ::absl::cord_internal::CordRepSubstring;
62 using ::absl::cord_internal::CordzUpdateTracker;
63 using ::absl::cord_internal::InlineData;
66 
69 
70 static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
71  int indent = 0);
72 static bool VerifyNode(CordRep* root, CordRep* start_node,
73  bool full_validation);
74 
75 static inline CordRep* VerifyTree(CordRep* node) {
76  // Verification is expensive, so only do it in debug mode.
77  // Even in debug mode we normally do only light validation.
78  // If you are debugging Cord itself, you should define the
79  // macro EXTRA_CORD_VALIDATION, e.g. by adding
80  // --copt=-DEXTRA_CORD_VALIDATION to the blaze line.
81 #ifdef EXTRA_CORD_VALIDATION
82  assert(node == nullptr || VerifyNode(node, node, /*full_validation=*/true));
83 #else // EXTRA_CORD_VALIDATION
84  assert(node == nullptr || VerifyNode(node, node, /*full_validation=*/false));
85 #endif // EXTRA_CORD_VALIDATION
86  static_cast<void>(&VerifyNode);
87 
88  return node;
89 }
90 
91 static CordRepFlat* CreateFlat(const char* data, size_t length,
92  size_t alloc_hint) {
93  CordRepFlat* flat = CordRepFlat::New(length + alloc_hint);
94  flat->length = length;
95  memcpy(flat->Data(), data, length);
96  return flat;
97 }
98 
99 // Creates a new flat or Btree out of the specified array.
100 // The returned node has a refcount of 1.
101 static CordRep* NewBtree(const char* data, size_t length, size_t alloc_hint) {
102  if (length <= kMaxFlatLength) {
103  return CreateFlat(data, length, alloc_hint);
104  }
105  CordRepFlat* flat = CreateFlat(data, kMaxFlatLength, 0);
106  data += kMaxFlatLength;
108  auto* root = CordRepBtree::Create(flat);
109  return CordRepBtree::Append(root, {data, length}, alloc_hint);
110 }
111 
112 // Create a new tree out of the specified array.
113 // The returned node has a refcount of 1.
114 static CordRep* NewTree(const char* data, size_t length, size_t alloc_hint) {
115  if (length == 0) return nullptr;
116  return NewBtree(data, length, alloc_hint);
117 }
118 
119 namespace cord_internal {
120 
122  assert(!data.empty());
123  rep->length = data.size();
124  rep->tag = EXTERNAL;
125  rep->base = data.data();
126  VerifyTree(rep);
127 }
128 
129 } // namespace cord_internal
130 
131 // Creates a CordRep from the provided string. If the string is large enough,
132 // and not wasteful, we move the string into an external cord rep, preserving
133 // the already allocated string contents.
134 // Requires the provided string length to be larger than `kMaxInline`.
135 static CordRep* CordRepFromString(std::string&& src) {
136  assert(src.length() > cord_internal::kMaxInline);
137  if (
138  // String is short: copy data to avoid external block overhead.
139  src.size() <= kMaxBytesToCopy ||
140  // String is wasteful: copy data to avoid pinning too much unused memory.
141  src.size() < src.capacity() / 2
142  ) {
143  return NewTree(src.data(), src.size(), 0);
144  }
145 
146  struct StringReleaser {
147  void operator()(absl::string_view /* data */) {}
149  };
150  const absl::string_view original_data = src;
151  auto* rep =
154  StringReleaser{std::move(src)}));
155  // Moving src may have invalidated its data pointer, so adjust it.
156  rep->base = rep->template get<0>().data.data();
157  return rep;
158 }
159 
160 // --------------------------------------------------------------------
161 // Cord::InlineRep functions
162 
163 #ifdef ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
164 constexpr unsigned char Cord::InlineRep::kMaxInline;
165 #endif
166 
167 inline void Cord::InlineRep::set_data(const char* data, size_t n) {
168  static_assert(kMaxInline == 15, "set_data is hard-coded for a length of 15");
169 
170  cord_internal::SmallMemmove<true>(data_.as_chars(), data, n);
172 }
173 
174 inline char* Cord::InlineRep::set_data(size_t n) {
175  assert(n <= kMaxInline);
176  ResetToEmpty();
177  set_inline_size(n);
178  return data_.as_chars();
179 }
180 
181 inline void Cord::InlineRep::reduce_size(size_t n) {
182  size_t tag = inline_size();
183  assert(tag <= kMaxInline);
184  assert(tag >= n);
185  tag -= n;
186  memset(data_.as_chars() + tag, 0, n);
187  set_inline_size(static_cast<char>(tag));
188 }
189 
190 inline void Cord::InlineRep::remove_prefix(size_t n) {
191  cord_internal::SmallMemmove(data_.as_chars(), data_.as_chars() + n,
192  inline_size() - n);
193  reduce_size(n);
194 }
195 
196 // Returns `rep` converted into a CordRepBtree.
197 // Directly returns `rep` if `rep` is already a CordRepBtree.
198 static CordRepBtree* ForceBtree(CordRep* rep) {
199  return rep->IsBtree()
200  ? rep->btree()
201  : CordRepBtree::Create(cord_internal::RemoveCrcNode(rep));
202 }
203 
206  assert(!is_tree());
207  if (!data_.is_empty()) {
208  CordRepFlat* flat = MakeFlatWithExtraCapacity(0);
209  tree = CordRepBtree::Append(CordRepBtree::Create(flat), tree);
210  }
211  EmplaceTree(tree, method);
212 }
213 
215  assert(is_tree());
216  const CordzUpdateScope scope(data_.cordz_info(), method);
217  tree = CordRepBtree::Append(ForceBtree(data_.as_tree()), tree);
218  SetTree(tree, scope);
219 }
220 
222  assert(tree != nullptr);
223  assert(tree->length != 0);
224  assert(!tree->IsCrc());
225  if (data_.is_tree()) {
226  AppendTreeToTree(tree, method);
227  } else {
228  AppendTreeToInlined(tree, method);
229  }
230 }
231 
234  assert(!is_tree());
235  if (!data_.is_empty()) {
236  CordRepFlat* flat = MakeFlatWithExtraCapacity(0);
237  tree = CordRepBtree::Prepend(CordRepBtree::Create(flat), tree);
238  }
239  EmplaceTree(tree, method);
240 }
241 
244  assert(is_tree());
245  const CordzUpdateScope scope(data_.cordz_info(), method);
246  tree = CordRepBtree::Prepend(ForceBtree(data_.as_tree()), tree);
247  SetTree(tree, scope);
248 }
249 
251  assert(tree != nullptr);
252  assert(tree->length != 0);
253  assert(!tree->IsCrc());
254  if (data_.is_tree()) {
255  PrependTreeToTree(tree, method);
256  } else {
257  PrependTreeToInlined(tree, method);
258  }
259 }
260 
261 // Searches for a non-full flat node at the rightmost leaf of the tree. If a
262 // suitable leaf is found, the function will update the length field for all
263 // nodes to account for the size increase. The append region address will be
264 // written to region and the actual size increase will be written to size.
265 static inline bool PrepareAppendRegion(CordRep* root, char** region,
266  size_t* size, size_t max_length) {
267  if (root->IsBtree() && root->refcount.IsOne()) {
268  Span<char> span = root->btree()->GetAppendBuffer(max_length);
269  if (!span.empty()) {
270  *region = span.data();
271  *size = span.size();
272  return true;
273  }
274  }
275 
276  CordRep* dst = root;
277  if (!dst->IsFlat() || !dst->refcount.IsOne()) {
278  *region = nullptr;
279  *size = 0;
280  return false;
281  }
282 
283  const size_t in_use = dst->length;
284  const size_t capacity = dst->flat()->Capacity();
285  if (in_use == capacity) {
286  *region = nullptr;
287  *size = 0;
288  return false;
289  }
290 
291  const size_t size_increase = std::min(capacity - in_use, max_length);
292  dst->length += size_increase;
293 
294  *region = dst->flat()->Data() + in_use;
295  *size = size_increase;
296  return true;
297 }
298 
300  assert(&src != this);
301  assert(is_tree() || src.is_tree());
302  auto constexpr method = CordzUpdateTracker::kAssignCord;
303  if (ABSL_PREDICT_TRUE(!is_tree())) {
304  EmplaceTree(CordRep::Ref(src.as_tree()), src.data_, method);
305  return;
306  }
307 
308  CordRep* tree = as_tree();
309  if (CordRep* src_tree = src.tree()) {
310  // Leave any existing `cordz_info` in place, and let MaybeTrackCord()
311  // decide if this cord should be (or remains to be) sampled or not.
312  data_.set_tree(CordRep::Ref(src_tree));
314  } else {
315  CordzInfo::MaybeUntrackCord(data_.cordz_info());
316  data_ = src.data_;
317  }
318  CordRep::Unref(tree);
319 }
320 
322  if (is_tree()) {
323  CordzInfo::MaybeUntrackCord(data_.cordz_info());
324  CordRep::Unref(tree());
325  }
326 }
327 
328 // --------------------------------------------------------------------
329 // Constructors and destructors
330 
332  : contents_(InlineData::kDefaultInit) {
333  const size_t n = src.size();
334  if (n <= InlineRep::kMaxInline) {
335  contents_.set_data(src.data(), n);
336  } else {
337  CordRep* rep = NewTree(src.data(), n, 0);
339  }
340 }
341 
342 template <typename T, Cord::EnableIfString<T>>
343 Cord::Cord(T&& src) : contents_(InlineData::kDefaultInit) {
344  if (src.size() <= InlineRep::kMaxInline) {
345  contents_.set_data(src.data(), src.size());
346  } else {
347  CordRep* rep = CordRepFromString(std::forward<T>(src));
349  }
350 }
351 
352 template Cord::Cord(std::string&& src);
353 
354 // The destruction code is separate so that the compiler can determine
355 // that it does not need to call the destructor on a moved-from Cord.
357  assert(contents_.is_tree());
360 }
361 
362 // --------------------------------------------------------------------
363 // Mutators
364 
365 void Cord::Clear() {
366  if (CordRep* tree = contents_.clear()) {
367  CordRep::Unref(tree);
368  }
369 }
370 
372  auto constexpr method = CordzUpdateTracker::kAssignString;
373  assert(src.size() > kMaxBytesToCopy);
375  if (CordRep* tree = contents_.tree()) {
377  contents_.SetTree(rep, scope);
378  CordRep::Unref(tree);
379  } else {
381  }
382  return *this;
383 }
384 
386  auto constexpr method = CordzUpdateTracker::kAssignString;
387  const char* data = src.data();
388  size_t length = src.size();
389  CordRep* tree = contents_.tree();
390  if (length <= InlineRep::kMaxInline) {
391  // Embed into this->contents_, which is somewhat subtle:
392  // - MaybeUntrackCord must be called before Unref(tree).
393  // - MaybeUntrackCord must be called before set_data() clobbers cordz_info.
394  // - set_data() must be called before Unref(tree) as it may reference tree.
395  if (tree != nullptr) CordzInfo::MaybeUntrackCord(contents_.cordz_info());
397  if (tree != nullptr) CordRep::Unref(tree);
398  return *this;
399  }
400  if (tree != nullptr) {
402  if (tree->IsFlat() && tree->flat()->Capacity() >= length &&
403  tree->refcount.IsOne()) {
404  // Copy in place if the existing FLAT node is reusable.
405  memmove(tree->flat()->Data(), data, length);
406  tree->length = length;
407  VerifyTree(tree);
408  return *this;
409  }
410  contents_.SetTree(NewTree(data, length, 0), scope);
411  CordRep::Unref(tree);
412  } else {
414  }
415  return *this;
416 }
417 
418 // TODO(sanjay): Move to Cord::InlineRep section of file. For now,
419 // we keep it here to make diffs easier.
422  if (src.empty()) return; // memcpy(_, nullptr, 0) is undefined.
423 
424  size_t appended = 0;
425  CordRep* rep = tree();
426  const CordRep* const root = rep;
427  CordzUpdateScope scope(root ? cordz_info() : nullptr, method);
428  if (root != nullptr) {
430  char* region;
431  if (PrepareAppendRegion(rep, &region, &appended, src.size())) {
432  memcpy(region, src.data(), appended);
433  }
434  } else {
435  // Try to fit in the inline buffer if possible.
436  size_t inline_length = inline_size();
437  if (src.size() <= kMaxInline - inline_length) {
438  // Append new data to embedded array
439  memcpy(data_.as_chars() + inline_length, src.data(), src.size());
440  set_inline_size(inline_length + src.size());
441  return;
442  }
443 
444  // Allocate flat to be a perfect fit on first append exceeding inlined size.
445  // Subsequent growth will use amortized growth until we reach maximum flat
446  // size.
447  rep = CordRepFlat::New(inline_length + src.size());
448  appended = std::min(src.size(), rep->flat()->Capacity() - inline_length);
449  memcpy(rep->flat()->Data(), data_.as_chars(), inline_length);
450  memcpy(rep->flat()->Data() + inline_length, src.data(), appended);
451  rep->length = inline_length + appended;
452  }
453 
454  src.remove_prefix(appended);
455  if (src.empty()) {
456  CommitTree(root, rep, scope, method);
457  return;
458  }
459 
460  // TODO(b/192061034): keep legacy 10% growth rate: consider other rates.
461  rep = ForceBtree(rep);
462  const size_t min_growth = std::max<size_t>(rep->length / 10, src.size());
463  rep = CordRepBtree::Append(rep->btree(), src, min_growth - src.size());
464 
465  CommitTree(root, rep, scope, method);
466 }
467 
469  return CordRep::Ref(contents_.tree());
470 }
471 
472 inline CordRep* Cord::TakeRep() && {
473  CordRep* rep = contents_.tree();
474  contents_.clear();
475  return rep;
476 }
477 
478 template <typename C>
479 inline void Cord::AppendImpl(C&& src) {
480  auto constexpr method = CordzUpdateTracker::kAppendCord;
481  if (empty()) {
482  // Since destination is empty, we can avoid allocating a node,
483  if (src.contents_.is_tree()) {
484  // by taking the tree directly
485  CordRep* rep =
486  cord_internal::RemoveCrcNode(std::forward<C>(src).TakeRep());
488  } else {
489  // or copying over inline data
490  contents_.data_ = src.contents_.data_;
491  }
492  return;
493  }
494 
495  // For short cords, it is faster to copy data if there is room in dst.
496  const size_t src_size = src.contents_.size();
497  if (src_size <= kMaxBytesToCopy) {
498  CordRep* src_tree = src.contents_.tree();
499  if (src_tree == nullptr) {
500  // src has embedded data.
501  contents_.AppendArray({src.contents_.data(), src_size}, method);
502  return;
503  }
504  if (src_tree->IsFlat()) {
505  // src tree just has one flat node.
506  contents_.AppendArray({src_tree->flat()->Data(), src_size}, method);
507  return;
508  }
509  if (&src == this) {
510  // ChunkIterator below assumes that src is not modified during traversal.
511  Append(Cord(src));
512  return;
513  }
514  // TODO(mec): Should we only do this if "dst" has space?
515  for (absl::string_view chunk : src.Chunks()) {
516  Append(chunk);
517  }
518  return;
519  }
520 
521  // Guaranteed to be a tree (kMaxBytesToCopy > kInlinedSize)
522  CordRep* rep = cord_internal::RemoveCrcNode(std::forward<C>(src).TakeRep());
524 }
525 
526 static CordRep::ExtractResult ExtractAppendBuffer(CordRep* rep,
527  size_t min_capacity) {
528  switch (rep->tag) {
530  return CordRepBtree::ExtractAppendBuffer(rep->btree(), min_capacity);
531  default:
532  if (rep->IsFlat() && rep->refcount.IsOne() &&
533  rep->flat()->Capacity() - rep->length >= min_capacity) {
534  return {nullptr, rep};
535  }
536  return {rep, nullptr};
537  }
538 }
539 
541  // Watch out for overflow, people can ask for size_t::max().
542  const size_t size = data.inline_size();
545  cord_internal::SmallMemmove(buffer.data(), data.as_chars(), size);
546  buffer.SetLength(size);
547  data = {};
548  return buffer;
549 }
550 
551 CordBuffer Cord::GetAppendBufferSlowPath(size_t capacity, size_t min_capacity) {
553  CordRep* tree = contents_.tree();
554  if (tree != nullptr) {
556  CordRep::ExtractResult result = ExtractAppendBuffer(tree, min_capacity);
557  if (result.extracted != nullptr) {
558  contents_.SetTreeOrEmpty(result.tree, scope);
559  return CordBuffer(result.extracted->flat());
560  }
562  }
564 }
565 
566 void Cord::Append(const Cord& src) {
567  AppendImpl(src);
568 }
569 
570 void Cord::Append(Cord&& src) {
571  AppendImpl(std::move(src));
572 }
573 
574 template <typename T, Cord::EnableIfString<T>>
575 void Cord::Append(T&& src) {
576  if (src.size() <= kMaxBytesToCopy) {
578  } else {
579  CordRep* rep = CordRepFromString(std::forward<T>(src));
581  }
582 }
583 
584 template void Cord::Append(std::string&& src);
585 
586 void Cord::Prepend(const Cord& src) {
587  CordRep* src_tree = src.contents_.tree();
588  if (src_tree != nullptr) {
589  CordRep::Ref(src_tree);
592  return;
593  }
594 
595  // `src` cord is inlined.
596  absl::string_view src_contents(src.contents_.data(), src.contents_.size());
597  return Prepend(src_contents);
598 }
599 
601  if (src.empty()) return; // memcpy(_, nullptr, 0) is undefined.
602  if (!contents_.is_tree()) {
603  size_t cur_size = contents_.inline_size();
604  if (cur_size + src.size() <= InlineRep::kMaxInline) {
605  // Use embedded storage.
606  char data[InlineRep::kMaxInline + 1] = {0};
607  memcpy(data, src.data(), src.size());
608  memcpy(data + src.size(), contents_.data(), cur_size);
610  contents_.set_inline_size(cur_size + src.size());
611  return;
612  }
613  }
614  CordRep* rep = NewTree(src.data(), src.size(), 0);
616 }
617 
619  assert(!src.empty());
620  assert(src.size() <= cord_internal::kMaxFlatLength);
621  if (contents_.remaining_inline_capacity() >= src.size()) {
622  const size_t inline_length = contents_.inline_size();
623  memcpy(contents_.data_.as_chars() + inline_length, src.data(), src.size());
624  contents_.set_inline_size(inline_length + src.size());
625  } else {
627  }
628 }
629 
631  assert(!src.empty());
632  assert(src.size() <= cord_internal::kMaxFlatLength);
633  if (contents_.remaining_inline_capacity() >= src.size()) {
634  const size_t inline_length = contents_.inline_size();
635  char data[InlineRep::kMaxInline + 1] = {0};
636  memcpy(data, src.data(), src.size());
637  memcpy(data + src.size(), contents_.data(), inline_length);
639  contents_.set_inline_size(inline_length + src.size());
640  } else {
642  }
643 }
644 
645 template <typename T, Cord::EnableIfString<T>>
646 inline void Cord::Prepend(T&& src) {
647  if (src.size() <= kMaxBytesToCopy) {
649  } else {
650  CordRep* rep = CordRepFromString(std::forward<T>(src));
652  }
653 }
654 
655 template void Cord::Prepend(std::string&& src);
656 
657 void Cord::RemovePrefix(size_t n) {
659  absl::StrCat("Requested prefix size ", n,
660  " exceeds Cord's size ", size()));
661  CordRep* tree = contents_.tree();
662  if (tree == nullptr) {
664  } else {
665  auto constexpr method = CordzUpdateTracker::kRemovePrefix;
667  tree = cord_internal::RemoveCrcNode(tree);
668  if (n >= tree->length) {
669  CordRep::Unref(tree);
670  tree = nullptr;
671  } else if (tree->IsBtree()) {
672  CordRep* old = tree;
673  tree = tree->btree()->SubTree(n, tree->length - n);
675  } else if (tree->IsSubstring() && tree->refcount.IsOne()) {
676  tree->substring()->start += n;
677  tree->length -= n;
678  } else {
679  CordRep* rep = CordRepSubstring::Substring(tree, n, tree->length - n);
680  CordRep::Unref(tree);
681  tree = rep;
682  }
683  contents_.SetTreeOrEmpty(tree, scope);
684  }
685 }
686 
687 void Cord::RemoveSuffix(size_t n) {
689  absl::StrCat("Requested suffix size ", n,
690  " exceeds Cord's size ", size()));
691  CordRep* tree = contents_.tree();
692  if (tree == nullptr) {
694  } else {
695  auto constexpr method = CordzUpdateTracker::kRemoveSuffix;
697  tree = cord_internal::RemoveCrcNode(tree);
698  if (n >= tree->length) {
699  CordRep::Unref(tree);
700  tree = nullptr;
701  } else if (tree->IsBtree()) {
702  tree = CordRepBtree::RemoveSuffix(tree->btree(), n);
703  } else if (!tree->IsExternal() && tree->refcount.IsOne()) {
704  assert(tree->IsFlat() || tree->IsSubstring());
705  tree->length -= n;
706  } else {
707  CordRep* rep = CordRepSubstring::Substring(tree, 0, tree->length - n);
708  CordRep::Unref(tree);
709  tree = rep;
710  }
711  contents_.SetTreeOrEmpty(tree, scope);
712  }
713 }
714 
715 Cord Cord::Subcord(size_t pos, size_t new_size) const {
716  Cord sub_cord;
717  size_t length = size();
718  if (pos > length) pos = length;
719  if (new_size > length - pos) new_size = length - pos;
720  if (new_size == 0) return sub_cord;
721 
722  CordRep* tree = contents_.tree();
723  if (tree == nullptr) {
724  sub_cord.contents_.set_data(contents_.data() + pos, new_size);
725  return sub_cord;
726  }
727 
729  char* dest = sub_cord.contents_.data_.as_chars();
731  it.AdvanceBytes(pos);
732  size_t remaining_size = new_size;
733  while (remaining_size > it->size()) {
734  cord_internal::SmallMemmove(dest, it->data(), it->size());
735  remaining_size -= it->size();
736  dest += it->size();
737  ++it;
738  }
739  cord_internal::SmallMemmove(dest, it->data(), remaining_size);
741  return sub_cord;
742  }
743 
744  tree = cord_internal::SkipCrcNode(tree);
745  if (tree->IsBtree()) {
746  tree = tree->btree()->SubTree(pos, new_size);
747  } else {
748  tree = CordRepSubstring::Substring(tree, pos, new_size);
749  }
750  sub_cord.contents_.EmplaceTree(tree, contents_.data_,
752  return sub_cord;
753 }
754 
755 // --------------------------------------------------------------------
756 // Comparators
757 
758 namespace {
759 
760 int ClampResult(int memcmp_res) {
761  return static_cast<int>(memcmp_res > 0) - static_cast<int>(memcmp_res < 0);
762 }
763 
764 int CompareChunks(absl::string_view* lhs, absl::string_view* rhs,
765  size_t* size_to_compare) {
766  size_t compared_size = std::min(lhs->size(), rhs->size());
767  assert(*size_to_compare >= compared_size);
768  *size_to_compare -= compared_size;
769 
770  int memcmp_res = ::memcmp(lhs->data(), rhs->data(), compared_size);
771  if (memcmp_res != 0) return memcmp_res;
772 
773  lhs->remove_prefix(compared_size);
774  rhs->remove_prefix(compared_size);
775 
776  return 0;
777 }
778 
779 // This overload set computes comparison results from memcmp result. This
780 // interface is used inside GenericCompare below. Differet implementations
781 // are specialized for int and bool. For int we clamp result to {-1, 0, 1}
782 // set. For bool we just interested in "value == 0".
783 template <typename ResultType>
784 ResultType ComputeCompareResult(int memcmp_res) {
785  return ClampResult(memcmp_res);
786 }
787 template <>
788 bool ComputeCompareResult<bool>(int memcmp_res) {
789  return memcmp_res == 0;
790 }
791 
792 } // namespace
793 
794 // Helper routine. Locates the first flat or external chunk of the Cord without
795 // initializing the iterator, and returns a string_view referencing the data.
797  if (!is_tree()) {
798  return absl::string_view(data_.as_chars(), data_.inline_size());
799  }
800 
801  CordRep* node = cord_internal::SkipCrcNode(tree());
802  if (node->IsFlat()) {
803  return absl::string_view(node->flat()->Data(), node->length);
804  }
805 
806  if (node->IsExternal()) {
807  return absl::string_view(node->external()->base, node->length);
808  }
809 
810  if (node->IsBtree()) {
811  CordRepBtree* tree = node->btree();
812  int height = tree->height();
813  while (--height >= 0) {
814  tree = tree->Edge(CordRepBtree::kFront)->btree();
815  }
816  return tree->Data(tree->begin());
817  }
818 
819  // Get the child node if we encounter a SUBSTRING.
820  size_t offset = 0;
821  size_t length = node->length;
822  assert(length != 0);
823 
824  if (node->IsSubstring()) {
825  offset = node->substring()->start;
826  node = node->substring()->child;
827  }
828 
829  if (node->IsFlat()) {
830  return absl::string_view(node->flat()->Data() + offset, length);
831  }
832 
833  assert(node->IsExternal() && "Expect FLAT or EXTERNAL node here");
834 
835  return absl::string_view(node->external()->base + offset, length);
836 }
837 
840  if (empty()) return;
841 
842  if (!contents_.is_tree()) {
844  rep = CordRepCrc::New(rep, crc);
846  } else {
849  contents_.SetTree(rep, scope);
850  }
851 }
852 
854  if (!contents_.is_tree() || !contents_.tree()->IsCrc()) {
855  return absl::nullopt;
856  }
857  return contents_.tree()->crc()->crc;
858 }
859 
860 inline int Cord::CompareSlowPath(absl::string_view rhs, size_t compared_size,
861  size_t size_to_compare) const {
862  auto advance = [](Cord::ChunkIterator* it, absl::string_view* chunk) {
863  if (!chunk->empty()) return true;
864  ++*it;
865  if (it->bytes_remaining_ == 0) return false;
866  *chunk = **it;
867  return true;
868  };
869 
870  Cord::ChunkIterator lhs_it = chunk_begin();
871 
872  // compared_size is inside first chunk.
873  absl::string_view lhs_chunk =
874  (lhs_it.bytes_remaining_ != 0) ? *lhs_it : absl::string_view();
875  assert(compared_size <= lhs_chunk.size());
876  assert(compared_size <= rhs.size());
877  lhs_chunk.remove_prefix(compared_size);
878  rhs.remove_prefix(compared_size);
879  size_to_compare -= compared_size; // skip already compared size.
880 
881  while (advance(&lhs_it, &lhs_chunk) && !rhs.empty()) {
882  int comparison_result = CompareChunks(&lhs_chunk, &rhs, &size_to_compare);
883  if (comparison_result != 0) return comparison_result;
884  if (size_to_compare == 0) return 0;
885  }
886 
887  return static_cast<int>(rhs.empty()) - static_cast<int>(lhs_chunk.empty());
888 }
889 
890 inline int Cord::CompareSlowPath(const Cord& rhs, size_t compared_size,
891  size_t size_to_compare) const {
892  auto advance = [](Cord::ChunkIterator* it, absl::string_view* chunk) {
893  if (!chunk->empty()) return true;
894  ++*it;
895  if (it->bytes_remaining_ == 0) return false;
896  *chunk = **it;
897  return true;
898  };
899 
900  Cord::ChunkIterator lhs_it = chunk_begin();
901  Cord::ChunkIterator rhs_it = rhs.chunk_begin();
902 
903  // compared_size is inside both first chunks.
904  absl::string_view lhs_chunk =
905  (lhs_it.bytes_remaining_ != 0) ? *lhs_it : absl::string_view();
906  absl::string_view rhs_chunk =
907  (rhs_it.bytes_remaining_ != 0) ? *rhs_it : absl::string_view();
908  assert(compared_size <= lhs_chunk.size());
909  assert(compared_size <= rhs_chunk.size());
910  lhs_chunk.remove_prefix(compared_size);
911  rhs_chunk.remove_prefix(compared_size);
912  size_to_compare -= compared_size; // skip already compared size.
913 
914  while (advance(&lhs_it, &lhs_chunk) && advance(&rhs_it, &rhs_chunk)) {
915  int memcmp_res = CompareChunks(&lhs_chunk, &rhs_chunk, &size_to_compare);
916  if (memcmp_res != 0) return memcmp_res;
917  if (size_to_compare == 0) return 0;
918  }
919 
920  return static_cast<int>(rhs_chunk.empty()) -
921  static_cast<int>(lhs_chunk.empty());
922 }
923 
925  return c.contents_.FindFlatStartPiece();
926 }
928  return sv;
929 }
930 
931 // Compares up to 'size_to_compare' bytes of 'lhs' with 'rhs'. It is assumed
932 // that 'size_to_compare' is greater that size of smallest of first chunks.
933 template <typename ResultType, typename RHS>
934 ResultType GenericCompare(const Cord& lhs, const RHS& rhs,
935  size_t size_to_compare) {
936  absl::string_view lhs_chunk = Cord::GetFirstChunk(lhs);
937  absl::string_view rhs_chunk = Cord::GetFirstChunk(rhs);
938 
939  size_t compared_size = std::min(lhs_chunk.size(), rhs_chunk.size());
940  assert(size_to_compare >= compared_size);
941  int memcmp_res = ::memcmp(lhs_chunk.data(), rhs_chunk.data(), compared_size);
942  if (compared_size == size_to_compare || memcmp_res != 0) {
943  return ComputeCompareResult<ResultType>(memcmp_res);
944  }
945 
946  return ComputeCompareResult<ResultType>(
947  lhs.CompareSlowPath(rhs, compared_size, size_to_compare));
948 }
949 
950 bool Cord::EqualsImpl(absl::string_view rhs, size_t size_to_compare) const {
951  return GenericCompare<bool>(*this, rhs, size_to_compare);
952 }
953 
954 bool Cord::EqualsImpl(const Cord& rhs, size_t size_to_compare) const {
955  return GenericCompare<bool>(*this, rhs, size_to_compare);
956 }
957 
958 template <typename RHS>
959 inline int SharedCompareImpl(const Cord& lhs, const RHS& rhs) {
960  size_t lhs_size = lhs.size();
961  size_t rhs_size = rhs.size();
962  if (lhs_size == rhs_size) {
963  return GenericCompare<int>(lhs, rhs, lhs_size);
964  }
965  if (lhs_size < rhs_size) {
966  auto data_comp_res = GenericCompare<int>(lhs, rhs, lhs_size);
967  return data_comp_res == 0 ? -1 : data_comp_res;
968  }
969 
970  auto data_comp_res = GenericCompare<int>(lhs, rhs, rhs_size);
971  return data_comp_res == 0 ? +1 : data_comp_res;
972 }
973 
975  return SharedCompareImpl(*this, rhs);
976 }
977 
978 int Cord::CompareImpl(const Cord& rhs) const {
979  return SharedCompareImpl(*this, rhs);
980 }
981 
983  size_t my_size = size();
984  size_t rhs_size = rhs.size();
985 
986  if (my_size < rhs_size) return false;
987 
988  Cord tmp(*this);
989  tmp.RemovePrefix(my_size - rhs_size);
990  return tmp.EqualsImpl(rhs, rhs_size);
991 }
992 
993 bool Cord::EndsWith(const Cord& rhs) const {
994  size_t my_size = size();
995  size_t rhs_size = rhs.size();
996 
997  if (my_size < rhs_size) return false;
998 
999  Cord tmp(*this);
1000  tmp.RemovePrefix(my_size - rhs_size);
1001  return tmp.EqualsImpl(rhs, rhs_size);
1002 }
1003 
1004 // --------------------------------------------------------------------
1005 // Misc.
1006 
1007 Cord::operator std::string() const {
1008  std::string s;
1009  absl::CopyCordToString(*this, &s);
1010  return s;
1011 }
1012 
1013 void CopyCordToString(const Cord& src, std::string* dst) {
1014  if (!src.contents_.is_tree()) {
1015  src.contents_.CopyTo(dst);
1016  } else {
1018  src.CopyToArraySlowPath(&(*dst)[0]);
1019  }
1020 }
1021 
1022 void Cord::CopyToArraySlowPath(char* dst) const {
1023  assert(contents_.is_tree());
1024  absl::string_view fragment;
1025  if (GetFlatAux(contents_.tree(), &fragment)) {
1026  memcpy(dst, fragment.data(), fragment.size());
1027  return;
1028  }
1029  for (absl::string_view chunk : Chunks()) {
1030  memcpy(dst, chunk.data(), chunk.size());
1031  dst += chunk.size();
1032  }
1033 }
1034 
1036  ABSL_HARDENING_ASSERT(bytes_remaining_ >= n &&
1037  "Attempted to iterate past `end()`");
1038  Cord subcord;
1039  auto constexpr method = CordzUpdateTracker::kCordReader;
1040 
1041  if (n <= InlineRep::kMaxInline) {
1042  // Range to read fits in inline data. Flatten it.
1043  char* data = subcord.contents_.set_data(n);
1044  while (n > current_chunk_.size()) {
1045  memcpy(data, current_chunk_.data(), current_chunk_.size());
1046  data += current_chunk_.size();
1047  n -= current_chunk_.size();
1048  ++*this;
1049  }
1050  memcpy(data, current_chunk_.data(), n);
1051  if (n < current_chunk_.size()) {
1052  RemoveChunkPrefix(n);
1053  } else if (n > 0) {
1054  ++*this;
1055  }
1056  return subcord;
1057  }
1058 
1059  if (btree_reader_) {
1060  size_t chunk_size = current_chunk_.size();
1061  if (n <= chunk_size && n <= kMaxBytesToCopy) {
1062  subcord = Cord(current_chunk_.substr(0, n), method);
1063  if (n < chunk_size) {
1064  current_chunk_.remove_prefix(n);
1065  } else {
1066  current_chunk_ = btree_reader_.Next();
1067  }
1068  } else {
1069  CordRep* rep;
1070  current_chunk_ = btree_reader_.Read(n, chunk_size, rep);
1071  subcord.contents_.EmplaceTree(rep, method);
1072  }
1073  bytes_remaining_ -= n;
1074  return subcord;
1075  }
1076 
1077  // Short circuit if reading the entire data edge.
1078  assert(current_leaf_ != nullptr);
1079  if (n == current_leaf_->length) {
1080  bytes_remaining_ = 0;
1081  current_chunk_ = {};
1082  CordRep* tree = CordRep::Ref(current_leaf_);
1083  subcord.contents_.EmplaceTree(VerifyTree(tree), method);
1084  return subcord;
1085  }
1086 
1087  // From this point on, we need a partial substring node.
1088  // Get pointer to the underlying flat or external data payload and
1089  // compute data pointer and offset into current flat or external.
1090  CordRep* payload = current_leaf_->IsSubstring()
1091  ? current_leaf_->substring()->child
1092  : current_leaf_;
1093  const char* data = payload->IsExternal() ? payload->external()->base
1094  : payload->flat()->Data();
1095  const size_t offset = current_chunk_.data() - data;
1096 
1097  auto* tree = CordRepSubstring::Substring(payload, offset, n);
1098  subcord.contents_.EmplaceTree(VerifyTree(tree), method);
1099  bytes_remaining_ -= n;
1100  current_chunk_.remove_prefix(n);
1101  return subcord;
1102 }
1103 
1104 char Cord::operator[](size_t i) const {
1106  size_t offset = i;
1107  const CordRep* rep = contents_.tree();
1108  if (rep == nullptr) {
1109  return contents_.data()[i];
1110  }
1112  while (true) {
1113  assert(rep != nullptr);
1114  assert(offset < rep->length);
1115  if (rep->IsFlat()) {
1116  // Get the "i"th character directly from the flat array.
1117  return rep->flat()->Data()[offset];
1118  } else if (rep->IsBtree()) {
1119  return rep->btree()->GetCharacter(offset);
1120  } else if (rep->IsExternal()) {
1121  // Get the "i"th character from the external array.
1122  return rep->external()->base[offset];
1123  } else {
1124  // This must be a substring a node, so bypass it to get to the child.
1125  assert(rep->IsSubstring());
1126  offset += rep->substring()->start;
1127  rep = rep->substring()->child;
1128  }
1129  }
1130 }
1131 
1133  assert(contents_.is_tree());
1134  size_t total_size = size();
1135  CordRep* new_rep;
1136  char* new_buffer;
1137 
1138  // Try to put the contents into a new flat rep. If they won't fit in the
1139  // biggest possible flat node, use an external rep instead.
1140  if (total_size <= kMaxFlatLength) {
1141  new_rep = CordRepFlat::New(total_size);
1142  new_rep->length = total_size;
1143  new_buffer = new_rep->flat()->Data();
1144  CopyToArraySlowPath(new_buffer);
1145  } else {
1146  new_buffer = std::allocator<char>().allocate(total_size);
1147  CopyToArraySlowPath(new_buffer);
1149  absl::string_view(new_buffer, total_size), [](absl::string_view s) {
1150  std::allocator<char>().deallocate(const_cast<char*>(s.data()),
1151  s.size());
1152  });
1153  }
1156  contents_.SetTree(new_rep, scope);
1157  return absl::string_view(new_buffer, total_size);
1158 }
1159 
1160 /* static */ bool Cord::GetFlatAux(CordRep* rep, absl::string_view* fragment) {
1161  assert(rep != nullptr);
1163  if (rep->IsFlat()) {
1164  *fragment = absl::string_view(rep->flat()->Data(), rep->length);
1165  return true;
1166  } else if (rep->IsExternal()) {
1167  *fragment = absl::string_view(rep->external()->base, rep->length);
1168  return true;
1169  } else if (rep->IsBtree()) {
1170  return rep->btree()->IsFlat(fragment);
1171  } else if (rep->IsSubstring()) {
1172  CordRep* child = rep->substring()->child;
1173  if (child->IsFlat()) {
1174  *fragment = absl::string_view(
1175  child->flat()->Data() + rep->substring()->start, rep->length);
1176  return true;
1177  } else if (child->IsExternal()) {
1178  *fragment = absl::string_view(
1179  child->external()->base + rep->substring()->start, rep->length);
1180  return true;
1181  } else if (child->IsBtree()) {
1182  return child->btree()->IsFlat(rep->substring()->start, rep->length,
1183  fragment);
1184  }
1185  }
1186  return false;
1187 }
1188 
1189 /* static */ void Cord::ForEachChunkAux(
1192  assert(rep != nullptr);
1194 
1195  if (rep->IsBtree()) {
1196  ChunkIterator it(rep), end;
1197  while (it != end) {
1198  callback(*it);
1199  ++it;
1200  }
1201  return;
1202  }
1203 
1204  // This is a leaf node, so invoke our callback.
1206  absl::string_view chunk;
1207  bool success = GetFlatAux(current_node, &chunk);
1208  assert(success);
1209  if (success) {
1210  callback(chunk);
1211  }
1212 }
1213 
1214 static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
1215  int indent) {
1216  const int kIndentStep = 1;
1219  for (;;) {
1220  *os << std::setw(3) << rep->refcount.Get();
1221  *os << " " << std::setw(7) << rep->length;
1222  *os << " [";
1223  if (include_data) *os << static_cast<void*>(rep);
1224  *os << "]";
1225  *os << " " << std::setw(indent) << "";
1226  if (rep->IsCrc()) {
1227  *os << "CRC crc=" << rep->crc()->crc << "\n";
1228  indent += kIndentStep;
1229  rep = rep->crc()->child;
1230  } else if (rep->IsSubstring()) {
1231  *os << "SUBSTRING @ " << rep->substring()->start << "\n";
1232  indent += kIndentStep;
1233  rep = rep->substring()->child;
1234  } else { // Leaf or ring
1235  if (rep->IsExternal()) {
1236  *os << "EXTERNAL [";
1237  if (include_data)
1239  *os << "]\n";
1240  } else if (rep->IsFlat()) {
1241  *os << "FLAT cap=" << rep->flat()->Capacity() << " [";
1242  if (include_data)
1243  *os << absl::CEscape(std::string(rep->flat()->Data(), rep->length));
1244  *os << "]\n";
1245  } else {
1246  CordRepBtree::Dump(rep, /*label=*/ "", include_data, *os);
1247  }
1248  if (stack.empty()) break;
1249  rep = stack.back();
1250  stack.pop_back();
1251  indent = indents.back();
1252  indents.pop_back();
1253  }
1254  }
1255  ABSL_INTERNAL_CHECK(indents.empty(), "");
1256 }
1257 
1259  std::ostringstream buf;
1260  buf << "Error at node " << node << " in:";
1261  DumpNode(root, true, &buf);
1262  return buf.str();
1263 }
1264 
1265 static bool VerifyNode(CordRep* root, CordRep* start_node,
1266  bool /* full_validation */) {
1268  worklist.push_back(start_node);
1269  do {
1270  CordRep* node = worklist.back();
1271  worklist.pop_back();
1272 
1273  ABSL_INTERNAL_CHECK(node != nullptr, ReportError(root, node));
1274  if (node != root) {
1275  ABSL_INTERNAL_CHECK(node->length != 0, ReportError(root, node));
1276  ABSL_INTERNAL_CHECK(!node->IsCrc(), ReportError(root, node));
1277  }
1278 
1279  if (node->IsFlat()) {
1280  ABSL_INTERNAL_CHECK(node->length <= node->flat()->Capacity(),
1281  ReportError(root, node));
1282  } else if (node->IsExternal()) {
1283  ABSL_INTERNAL_CHECK(node->external()->base != nullptr,
1284  ReportError(root, node));
1285  } else if (node->IsSubstring()) {
1287  node->substring()->start < node->substring()->child->length,
1288  ReportError(root, node));
1289  ABSL_INTERNAL_CHECK(node->substring()->start + node->length <=
1290  node->substring()->child->length,
1291  ReportError(root, node));
1292  } else if (node->IsCrc()) {
1293  ABSL_INTERNAL_CHECK(node->crc()->child != nullptr,
1294  ReportError(root, node));
1295  ABSL_INTERNAL_CHECK(node->crc()->length == node->crc()->child->length,
1296  ReportError(root, node));
1297  worklist.push_back(node->crc()->child);
1298  }
1299  } while (!worklist.empty());
1300  return true;
1301 }
1302 
1303 std::ostream& operator<<(std::ostream& out, const Cord& cord) {
1304  for (absl::string_view chunk : cord.Chunks()) {
1305  out.write(chunk.data(), chunk.size());
1306  }
1307  return out;
1308 }
1309 
1310 namespace strings_internal {
1311 size_t CordTestAccess::FlatOverhead() { return cord_internal::kFlatOverhead; }
1312 size_t CordTestAccess::MaxFlatLength() { return cord_internal::kMaxFlatLength; }
1313 size_t CordTestAccess::FlatTagToLength(uint8_t tag) {
1315 }
1316 uint8_t CordTestAccess::LengthToTag(size_t s) {
1317  ABSL_INTERNAL_CHECK(s <= kMaxFlatLength, absl::StrCat("Invalid length ", s));
1319 }
1320 size_t CordTestAccess::SizeofCordRepExternal() {
1321  return sizeof(CordRepExternal);
1322 }
1323 size_t CordTestAccess::SizeofCordRepSubstring() {
1324  return sizeof(CordRepSubstring);
1325 }
1326 } // namespace strings_internal
1328 } // namespace absl
absl::cord_internal::CordzUpdateTracker::kFlatten
@ kFlatten
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:52
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
absl::Cord::InlineRep::data_
cord_internal::InlineData data_
Definition: abseil-cpp/absl/strings/cord.h:935
absl::Cord
Definition: abseil-cpp/absl/strings/cord.h:150
absl::VerifyTree
static CordRep * VerifyTree(CordRep *node)
Definition: abseil-cpp/absl/strings/cord.cc:75
absl::cord_internal::EXTERNAL
@ EXTERNAL
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:183
dst
static const char dst[]
Definition: test-fs-copyfile.c:37
absl::Cord::size
size_t size() const
Definition: abseil-cpp/absl/strings/cord.h:1288
absl::Cord::InlineRep::reduce_size
void reduce_size(size_t n)
Definition: abseil-cpp/absl/strings/cord.cc:181
absl::cord_internal::AllocatedSizeToTag
uint8_t AllocatedSizeToTag(size_t size)
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:92
regen-readme.it
it
Definition: regen-readme.py:15
absl::Cord::CordRep
absl::cord_internal::CordRep CordRep
Definition: abseil-cpp/absl/strings/cord.h:762
cord_data_edge.h
pos
int pos
Definition: libuv/docs/code/tty-gravity/main.c:11
absl::cord_internal::CordRep::IsBtree
constexpr bool IsBtree() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:250
absl::Cord::InlineRep::FindFlatStartPiece
absl::string_view FindFlatStartPiece() const
Definition: abseil-cpp/absl/strings/cord.cc:796
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
absl::SharedCompareImpl
int SharedCompareImpl(const Cord &lhs, const RHS &rhs)
Definition: abseil-cpp/absl/strings/cord.cc:959
absl::cord_internal::CordzUpdateTracker::kSubCord
@ kSubCord
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:65
absl::Cord::DestroyCordSlow
void DestroyCordSlow()
Definition: abseil-cpp/absl/strings/cord.cc:356
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
memset
return memset(p, 0, total)
absl::ExtractAppendBuffer
static CordRep::ExtractResult ExtractAppendBuffer(CordRep *rep, size_t min_capacity)
Definition: abseil-cpp/absl/strings/cord.cc:526
absl::Cord::operator=
Cord & operator=(const Cord &x)
Definition: abseil-cpp/absl/strings/cord.h:1259
absl::cord_internal::CordRep::Unref
static void Unref(CordRep *rep)
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:642
absl::Cord::AppendImpl
void AppendImpl(C &&src)
Definition: abseil-cpp/absl/strings/cord.cc:479
capacity
uint16_t capacity
Definition: protobuf/src/google/protobuf/descriptor.cc:948
absl::cord_internal::CordRepFlat::New
static CordRepFlat * New(size_t len)
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:128
absl::cord_internal::CordRep::external
CordRepExternal * external()
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:624
absl::operator<<
ABSL_NAMESPACE_BEGIN std::ostream & operator<<(std::ostream &os, absl::LogSeverity s)
Definition: abseil-cpp/absl/base/log_severity.cc:24
absl::Span
Definition: abseil-cpp/absl/types/span.h:152
absl::Cord::PrependArray
void PrependArray(absl::string_view src, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:600
re2::Dump
static void Dump(StringPiece pattern, Regexp::ParseFlags flags, std::string *forward, std::string *reverse)
Definition: bloaty/third_party/re2/re2/testing/compile_test.cc:242
absl::Cord::InlineRep::data
const char * data() const
Definition: abseil-cpp/absl/strings/cord.h:1148
absl::Cord::Compare
int Compare(absl::string_view rhs) const
Definition: abseil-cpp/absl/strings/cord.cc:974
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
absl::Cord::FlattenSlowPath
absl::string_view FlattenSlowPath()
Definition: abseil-cpp/absl/strings/cord.cc:1132
ABSL_INTERNAL_CHECK
#define ABSL_INTERNAL_CHECK(condition, message)
Definition: abseil-cpp/absl/base/internal/raw_logging.h:85
absl::cord_internal::CordRepFlat::Capacity
size_t Capacity() const
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:166
absl::PrepareAppendRegion
static bool PrepareAppendRegion(CordRep *root, char **region, size_t *size, size_t max_length)
Definition: abseil-cpp/absl/strings/cord.cc:265
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
absl::Cord::InlineRep::PrependTreeToInlined
void PrependTreeToInlined(CordRep *tree, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:232
binary_size.new_size
def new_size
Definition: binary_size.py:124
absl::Cord::InlineRep::kMaxInline
static constexpr unsigned char kMaxInline
Definition: abseil-cpp/absl/strings/cord.h:795
absl::debugging_internal::Append
static void Append(State *state, const char *const str, const int length)
Definition: abseil-cpp/absl/debugging/internal/demangle.cc:359
New
T * New(Args &&... args)
Definition: third_party/boringssl-with-bazel/src/ssl/internal.h:195
absl::cord_internal::kMaxFlatLength
static constexpr size_t kMaxFlatLength
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:45
absl::Cord::InlineRep::size
size_t size() const
Definition: abseil-cpp/absl/strings/cord.h:1172
absl::Cord::GetAppendBufferSlowPath
CordBuffer GetAppendBufferSlowPath(size_t capacity, size_t min_capacity)
Definition: abseil-cpp/absl/strings/cord.cc:551
absl::FormatConversionChar::s
@ s
absl::cord_internal::RemoveCrcNode
CordRep * RemoveCrcNode(CordRep *rep)
Definition: cord_rep_crc.h:53
absl::CEscape
std::string CEscape(absl::string_view src)
Definition: abseil-cpp/absl/strings/escaping.cc:854
python_utils.upload_rbe_results.indent
indent
Definition: upload_rbe_results.py:183
absl::InlinedVector::pop_back
void pop_back() noexcept
Definition: abseil-cpp/absl/container/inlined_vector.h:693
ABSL_NAMESPACE_END
#define ABSL_NAMESPACE_END
Definition: third_party/abseil-cpp/absl/base/config.h:171
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
absl::cord_internal::CordRep::IsCrc
constexpr bool IsCrc() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:247
absl::Span::empty
constexpr bool empty() const noexcept
Definition: abseil-cpp/absl/types/span.h:271
absl::cord_internal::CordRep
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:209
absl::cord_internal::InlineData::as_chars
const char * as_chars() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:525
absl::cord_internal::InitializeCordRepExternal
void InitializeCordRepExternal(absl::string_view data, CordRepExternal *rep)
Definition: abseil-cpp/absl/strings/cord.cc:121
ABSL_HARDENING_ASSERT
#define ABSL_HARDENING_ASSERT(expr)
Definition: abseil-cpp/absl/base/macros.h:134
T
#define T(upbtypeconst, upbtype, ctype, default_value)
absl::cord_internal::CordRep::ExtractResult
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:217
absl::cord_internal::CordzUpdateTracker::MethodIdentifier
MethodIdentifier
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:40
absl::cord_internal::CordzUpdateTracker::kRemovePrefix
@ kRemovePrefix
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:62
absl::Cord::RemoveSuffix
void RemoveSuffix(size_t n)
Definition: abseil-cpp/absl/strings/cord.cc:687
absl::Cord::empty
bool empty() const
Definition: abseil-cpp/absl/strings/cord.h:1293
absl::Cord::InlineData
cord_internal::InlineData InlineData
Definition: abseil-cpp/absl/strings/cord.h:767
absl::Cord::InlineRep::UnrefTree
void UnrefTree()
Definition: abseil-cpp/absl/strings/cord.cc:321
absl::cord_internal::CordRep::tag
uint8_t tag
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:232
absl::Cord::InlineRep
Definition: abseil-cpp/absl/strings/cord.h:793
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
absl::Cord::ChunkIterator::bytes_remaining_
size_t bytes_remaining_
Definition: abseil-cpp/absl/strings/cord.h:464
absl::Cord::InlineRep::set_inline_size
void set_inline_size(size_t size)
Definition: abseil-cpp/absl/strings/cord.h:932
absl::Cord::InlineRep::clear
absl::cord_internal::CordRep * clear()
Definition: abseil-cpp/absl/strings/cord.h:1228
absl::InlinedVector::back
reference back()
Definition: abseil-cpp/absl/container/inlined_vector.h:377
absl::cord_internal::CordzUpdateTracker::kConstructorString
@ kConstructorString
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:50
absl::Cord::InlineRep::AppendTreeToInlined
void AppendTreeToInlined(CordRep *tree, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:204
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
absl::Cord::InlineRep::as_tree
absl::cord_internal::CordRep * as_tree() const
Definition: abseil-cpp/absl/strings/cord.h:1157
absl::cord_internal::CordRepBtree::GetCharacter
char GetCharacter(size_t offset) const
Definition: cord_rep_btree.cc:988
absl::cord_internal::CordzUpdateTracker::kAppendString
@ kAppendString
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:45
ABSL_NAMESPACE_BEGIN
#define ABSL_NAMESPACE_BEGIN
Definition: third_party/abseil-cpp/absl/base/config.h:170
absl::cord_internal::RefcountAndFlags::Get
int32_t Get() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:132
absl::Cord::Chunks
ChunkRange Chunks() const
Definition: abseil-cpp/absl/strings/cord.h:1509
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
absl::Cord::operator[]
char operator[](size_t i) const
Definition: abseil-cpp/absl/strings/cord.cc:1104
absl::cord_internal::CordRepExternal
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:306
absl::Cord::ExpectedChecksum
absl::optional< uint32_t > ExpectedChecksum() const
Definition: abseil-cpp/absl/strings/cord.cc:853
absl::CreateFlat
static CordRepFlat * CreateFlat(const char *data, size_t length, size_t alloc_hint)
Definition: abseil-cpp/absl/strings/cord.cc:91
absl::Cord::PrependPrecise
void PrependPrecise(absl::string_view src, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:630
absl::cord_internal::kMaxInline
@ kMaxInline
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:418
absl::string_view::size
constexpr size_type size() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:277
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
absl::ABSL_NAMESPACE_BEGIN::RemoveSuffix
CordRepSubstring * RemoveSuffix(size_t length, CordRep *rep)
Definition: abseil-cpp/absl/strings/cord_ring_test.cc:260
root
RefCountedPtr< grpc_tls_certificate_provider > root
Definition: xds_server_config_fetcher.cc:223
absl::Cord::InlineRep::set_data
void set_data(const char *data, size_t n)
Definition: abseil-cpp/absl/strings/cord.cc:167
absl::VerifyNode
static bool VerifyNode(CordRep *root, CordRep *start_node, bool full_validation)
Definition: abseil-cpp/absl/strings/cord.cc:1265
absl::Cord::GetFlatAux
static bool GetFlatAux(absl::cord_internal::CordRep *rep, absl::string_view *fragment)
Definition: abseil-cpp/absl/strings/cord.cc:1160
absl::Cord::InlineRep::CopyTo
void CopyTo(std::string *dst) const
Definition: abseil-cpp/absl/strings/cord.h:884
absl::cord_internal::CordzInfo::MaybeUntrackCord
static void MaybeUntrackCord(CordzInfo *info)
Definition: abseil-cpp/absl/strings/internal/cordz_info.h:269
absl::cord_internal::CordRep::refcount
RefcountAndFlags refcount
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:229
absl::ForceBtree
static CordRepBtree * ForceBtree(CordRep *rep)
Definition: abseil-cpp/absl/strings/cord.cc:198
absl::cord_internal::kFlatOverhead
static constexpr size_t kFlatOverhead
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:42
absl::cord_internal::CordzUpdateTracker::kPrependCord
@ kPrependCord
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:59
absl::cord_internal::CordRep::IsFlat
constexpr bool IsFlat() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:249
absl::InlinedVector::push_back
void push_back(const_reference v)
Definition: abseil-cpp/absl/container/inlined_vector.h:682
absl::Cord::InlineRep::remaining_inline_capacity
size_t remaining_inline_capacity() const
Definition: abseil-cpp/absl/strings/cord.h:905
cord_buffer.h
absl::Cord::InlineRep::AssignSlow
void AssignSlow(const InlineRep &src)
Definition: abseil-cpp/absl/strings/cord.cc:299
absl::Cord::Prepend
void Prepend(const Cord &src)
Definition: abseil-cpp/absl/strings/cord.cc:586
absl::Cord::InlineRep::AppendArray
void AppendArray(absl::string_view src, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:420
absl::Cord::Clear
ABSL_ATTRIBUTE_REINITIALIZES void Clear()
Definition: abseil-cpp/absl/strings/cord.cc:365
absl::optional< uint32_t >
absl::cord_internal::CordzUpdateTracker::kGetAppendBuffer
@ kGetAppendBuffer
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:53
absl::Cord::EqualsImpl
bool EqualsImpl(absl::string_view rhs, size_t size_to_compare) const
Definition: abseil-cpp/absl/strings/cord.cc:950
cord_rep_btree.h
googletest-filter-unittest.child
child
Definition: bloaty/third_party/googletest/googletest/test/googletest-filter-unittest.py:62
advance
static void advance(upb_pbdecoder *d, size_t len)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:6553
absl::DumpNode
static void DumpNode(CordRep *rep, bool include_data, std::ostream *os, int indent=0)
Definition: abseil-cpp/absl/strings/cord.cc:1214
stack
NodeStack stack
Definition: cord_rep_btree.cc:356
absl::Cord::TakeRep
absl::cord_internal::CordRep * TakeRep() const &
Definition: abseil-cpp/absl/strings/cord.cc:468
absl::Cord::AppendPrecise
void AppendPrecise(absl::string_view src, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:618
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
callback
static void callback(void *arg, int status, int timeouts, struct hostent *host)
Definition: acountry.c:224
absl::Cord::GetFirstChunk
static absl::string_view GetFirstChunk(const Cord &c)
Definition: abseil-cpp/absl/strings/cord.cc:924
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
absl::cord_internal::CordRepSubstring::start
size_t start
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:281
min
#define min(a, b)
Definition: qsort.h:83
absl::cord_internal::InlineData::as_tree
CordRep * as_tree() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:549
absl::Cord::CompareSlowPath
int CompareSlowPath(absl::string_view rhs, size_t compared_size, size_t size_to_compare) const
Definition: abseil-cpp/absl/strings/cord.cc:860
absl::cord_internal::CordRepFlat::Create
static CordRepFlat * Create(absl::string_view data, size_t extra=0)
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:153
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
tests.qps.qps_worker.dest
dest
Definition: qps_worker.py:45
absl::Cord::RemovePrefix
void RemovePrefix(size_t n)
Definition: abseil-cpp/absl/strings/cord.cc:657
absl::cord_internal::CordRep::IsSubstring
constexpr bool IsSubstring() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:246
ABSL_PREDICT_TRUE
#define ABSL_PREDICT_TRUE(x)
Definition: abseil-cpp/absl/base/optimization.h:181
absl::Cord::CompareImpl
int CompareImpl(const Cord &rhs) const
Definition: abseil-cpp/absl/strings/cord.cc:978
absl::cord_internal::CordRepExternalImpl
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:339
absl::Cord::contents_
InlineRep contents_
Definition: abseil-cpp/absl/strings/cord.h:937
absl::Cord::Subcord
Cord Subcord(size_t pos, size_t new_size) const
Definition: abseil-cpp/absl/strings/cord.cc:715
absl::Cord::InlineRep::PrependTree
void PrependTree(CordRep *tree, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:250
absl::cord_internal::CordRepCrc::crc
uint32_t crc
Definition: cord_rep_crc.h:37
absl::cord_internal::CordRep::length
size_t length
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:228
absl::cord_internal::kInlinedVectorSize
@ kInlinedVectorSize
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:85
absl::cord_internal::CordRep::IsExternal
constexpr bool IsExternal() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:248
absl::cord_internal::CordRepBtree::SubTree
CordRep * SubTree(size_t offset, size_t n)
Definition: cord_rep_btree.cc:892
absl::cord_internal::NewExternalRep
CordRep * NewExternalRep(absl::string_view data, Releaser &&releaser)
Definition: abseil-cpp/absl/strings/cord.h:1067
absl::cord_internal::CordzUpdateTracker::kAssignCord
@ kAssignCord
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:46
absl::cord_internal::BTREE
@ BTREE
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:181
absl::CordBuffer::CreateWithDefaultLimit
static CordBuffer CreateWithDefaultLimit(size_t capacity)
Definition: cord_buffer.h:465
absl::NewTree
static CordRep * NewTree(const char *data, size_t length, size_t alloc_hint)
Definition: abseil-cpp/absl/strings/cord.cc:114
absl::Cord::ChunkIterator::AdvanceAndReadBytes
Cord AdvanceAndReadBytes(size_t n)
Definition: abseil-cpp/absl/strings/cord.cc:1035
absl::cord_internal::CordRep::btree
CordRepBtree * btree()
Definition: cord_rep_btree.h:589
absl::Cord::SetExpectedChecksum
void SetExpectedChecksum(uint32_t crc)
Definition: abseil-cpp/absl/strings/cord.cc:838
absl::cord_internal::CordzInfo::MaybeTrackCord
static void MaybeTrackCord(InlineData &cord, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/internal/cordz_info.h:255
absl::Cord::InlineRep::cordz_info
absl::cord_internal::CordzInfo * cordz_info() const
Definition: abseil-cpp/absl/strings/cord.h:910
absl::cord_internal::SmallMemmove
void SmallMemmove(char *dst, const char *src, size_t n)
Definition: abseil-cpp/absl/strings/cord.h:1023
absl::cord_internal::CordzUpdateTracker::kSetExpectedChecksum
@ kSetExpectedChecksum
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:64
absl::cord_internal::CordzUpdateTracker::kAssignString
@ kAssignString
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:47
absl::cord_internal::CordzUpdateTracker::kRemoveSuffix
@ kRemoveSuffix
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:63
absl::Cord::ForEachChunkAux
static void ForEachChunkAux(absl::cord_internal::CordRep *rep, absl::FunctionRef< void(absl::string_view)> callback)
Definition: abseil-cpp/absl/strings/cord.cc:1189
absl::Cord::InlineRep::tree
absl::cord_internal::CordRep * tree() const
Definition: abseil-cpp/absl/strings/cord.h:1162
absl::string_view::remove_prefix
ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR void remove_prefix(size_type n)
Definition: abseil-cpp/absl/strings/string_view.h:344
absl::strings_internal::STLStringResizeUninitialized
void STLStringResizeUninitialized(string_type *s, size_t new_size)
Definition: abseil-cpp/absl/strings/internal/resize_uninitialized.h:67
absl::cord_internal::TagToLength
constexpr size_t TagToLength(uint8_t tag)
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:99
absl::CopyCordToString
void CopyCordToString(const Cord &src, std::string *dst)
Definition: abseil-cpp/absl/strings/cord.cc:1013
absl::Span::size
constexpr size_type size() const noexcept
Definition: abseil-cpp/absl/types/span.h:261
absl::Cord::AssignLargeString
Cord & AssignLargeString(std::string &&src)
Definition: abseil-cpp/absl/strings/cord.cc:371
absl::Cord::InlineRep::CommitTree
void CommitTree(const CordRep *old_rep, CordRep *rep, const CordzUpdateScope &scope, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.h:1218
absl::cord_internal::CordzUpdateTracker::kPrependString
@ kPrependString
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:61
absl::cord_internal::CordRepFlat::Data
char * Data()
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:162
absl::Cord::GenericCompare
friend ResultType GenericCompare(const Cord &lhs, const RHS &rhs, size_t size_to_compare)
Definition: abseil-cpp/absl/strings/cord.cc:934
string_view
absl::string_view string_view
Definition: attr.cc:22
absl::Cord::InlineRep::MakeFlatWithExtraCapacity
CordRepFlat * MakeFlatWithExtraCapacity(size_t extra)
Definition: abseil-cpp/absl/strings/cord.h:1176
rep
const CordRep * rep
Definition: cord_analysis.cc:53
absl::Cord::CopyCordToString
friend void CopyCordToString(const Cord &src, std::string *dst)
Definition: abseil-cpp/absl/strings/cord.cc:1013
data_
std::string data_
Definition: cord_rep_btree_navigator_test.cc:84
absl::cord_internal::CordRep::Ref
static CordRep * Ref(CordRep *rep)
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:634
absl::Cord::InlineRep::SetTreeOrEmpty
void SetTreeOrEmpty(CordRep *rep, const CordzUpdateScope &scope)
Definition: abseil-cpp/absl/strings/cord.h:1207
absl::FunctionRef
Definition: abseil-cpp/absl/functional/function_ref.h:65
absl::NewBtree
static CordRep * NewBtree(const char *data, size_t length, size_t alloc_hint)
Definition: abseil-cpp/absl/strings/cord.cc:101
absl::CordBuffer
Definition: cord_buffer.h:105
absl::cord_internal::CordRepSubstring::child
CordRep * child
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:282
python_utils.port_server.in_use
dictionary in_use
Definition: port_server.py:57
absl::Cord::Cord
constexpr Cord() noexcept
Definition: abseil-cpp/absl/strings/cord.h:1244
absl::cord_internal::InlineData::cordz_info
CordzInfo * cordz_info() const
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:499
absl::cord_internal::CordRep::crc
CordRepCrc * crc()
Definition: cord_rep_crc.h:88
absl::Cord::InlineRep::PrependTreeToTree
void PrependTreeToTree(CordRep *tree, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:242
absl::cord_internal::CordRepExternal::base
const char * base
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:313
absl::string_view::empty
constexpr bool empty() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:292
absl
Definition: abseil-cpp/absl/algorithm/algorithm.h:31
absl::InlinedVector::empty
bool empty() const noexcept
Definition: abseil-cpp/absl/container/inlined_vector.h:265
absl::Cord::InlineRep::AppendTreeToTree
void AppendTreeToTree(CordRep *tree, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:214
absl::Cord::InlineRep::is_tree
bool is_tree() const
Definition: abseil-cpp/absl/strings/cord.h:899
absl::CordRepFromString
static CordRep * CordRepFromString(std::string &&src)
Definition: abseil-cpp/absl/strings/cord.cc:135
absl::Cord::InlineRep::EmplaceTree
void EmplaceTree(CordRep *rep, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.h:1186
absl::out
char * out
Definition: abseil-cpp/absl/synchronization/mutex.h:1048
absl::InlinedVector< CordRep *, kInlinedVectorSize >
autogen_x86imm.tmp
tmp
Definition: autogen_x86imm.py:12
absl::ReportError
static std::string ReportError(CordRep *root, CordRep *node)
Definition: abseil-cpp/absl/strings/cord.cc:1258
absl::cord_internal::CordRepBtree::IsFlat
bool IsFlat(absl::string_view *fragment) const
Definition: cord_rep_btree.cc:960
absl::Cord::InlineRep::AppendTree
void AppendTree(CordRep *tree, MethodIdentifier method)
Definition: abseil-cpp/absl/strings/cord.cc:221
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
absl::cord_internal::CordzUpdateScope
Definition: abseil-cpp/absl/strings/internal/cordz_update_scope.h:33
absl::cord_internal::kMinFlatLength
static constexpr size_t kMinFlatLength
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:46
length
std::size_t length
Definition: abseil-cpp/absl/time/internal/test_util.cc:57
absl::Cord::chunk_begin
ChunkIterator chunk_begin() const
Definition: abseil-cpp/absl/strings/cord.h:1495
absl::Cord::CopyToArraySlowPath
void CopyToArraySlowPath(char *dst) const
Definition: abseil-cpp/absl/strings/cord.cc:1022
absl::Cord::InlineRep::SetTree
void SetTree(CordRep *rep, const CordzUpdateScope &scope)
Definition: abseil-cpp/absl/strings/cord.h:1199
method
NSString * method
Definition: ProtoMethod.h:28
absl::cord_internal::SkipCrcNode
CordRep * SkipCrcNode(CordRep *rep)
Definition: cord_rep_crc.h:70
absl::Cord::InlineRep::inline_size
size_t inline_size() const
Definition: abseil-cpp/absl/strings/cord.h:933
absl::CreateAppendBuffer
static CordBuffer CreateAppendBuffer(InlineData &data, size_t capacity)
Definition: abseil-cpp/absl/strings/cord.cc:540
absl::cord_internal::CordzUpdateTracker::kAppendCord
@ kAppendCord
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:42
gen_server_registered_method_bad_client_test_body.payload
list payload
Definition: gen_server_registered_method_bad_client_test_body.py:40
absl::Cord::EndsWith
bool EndsWith(absl::string_view rhs) const
Definition: abseil-cpp/absl/strings/cord.cc:982
absl::string_view::data
constexpr const_pointer data() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:336
absl::Cord::InlineRep::remove_prefix
void remove_prefix(size_t n)
Definition: abseil-cpp/absl/strings/cord.cc:190
absl::cord_internal::RefcountAndFlags::IsOne
bool IsOne()
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:144
absl::Span::data
constexpr pointer data() const noexcept
Definition: abseil-cpp/absl/types/span.h:256
absl::cord_internal::CordRepCrc::child
CordRep * child
Definition: cord_rep_crc.h:36
binary_size.old
string old
Definition: binary_size.py:128
absl::cord_internal::CordRepFlat
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:107
absl::Cord::ChunkIterator
Definition: abseil-cpp/absl/strings/cord.h:412
absl::cord_internal::CordRep::substring
CordRepSubstring * substring()
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:614
absl::Cord::Append
void Append(const Cord &src)
Definition: abseil-cpp/absl/strings/cord.cc:566
absl::cord_internal::kMaxBytesToCopy
@ kMaxBytesToCopy
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:88
absl::cord_internal::InlineData
Definition: abseil-cpp/absl/strings/internal/cord_internal.h:447
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
cord_rep_crc.h
offset
voidpf uLong offset
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:142
contents_
string_view contents_
Definition: elf.cc:93
height
int height
Definition: libuv/docs/code/tty-gravity/main.c:10
absl::cord_internal::CordzUpdateTracker::kCordReader
@ kCordReader
Definition: abseil-cpp/absl/strings/internal/cordz_update_tracker.h:51
absl::cord_internal::CordRep::flat
CordRepFlat * flat()
Definition: abseil-cpp/absl/strings/internal/cord_rep_flat.h:173


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:02