Export of internal Abseil changes
--
a7924266cefd1c175142545996c967fb18b6144f by Abseil Team <absl-team@google.com>:
Document the performance advantages of the `ToInt64*()` family of functions.
PiperOrigin-RevId: 396736253
--
77aa845d3aa4c56a48b899ce5a5ffcf9b81991b3 by Matt Kulukundis <kfm@google.com>:
tiny cleanup: remove redundant `public:`
PiperOrigin-RevId: 396615677
--
b837e3de0ebd99e4c4f692a80a5d7ece3e829d18 by Martijn Vels <mvels@google.com>:
Make btree growth factor identical to concat code
The btree code is using a more aggressive growth rate on Cord::Append than the Concat version. To minimize impact on migration and existing tests using empirical assumptions on growth, this change makes the btree use the same rate as Concat logic.
PiperOrigin-RevId: 396595109
--
e958c06b6ab52e389caa7b3e43d83f924367e79c by Martijn Vels <mvels@google.com>:
Change CordRepBtree::Dump to include capacity of flats
PiperOrigin-RevId: 396591195
GitOrigin-RevId: a7924266cefd1c175142545996c967fb18b6144f
Change-Id: Ia38c09ba9891364b0727509dec4776eb6aadf984
diff --git a/absl/profiling/internal/sample_recorder.h b/absl/profiling/internal/sample_recorder.h
index a257ea5..5e04a9c 100644
--- a/absl/profiling/internal/sample_recorder.h
+++ b/absl/profiling/internal/sample_recorder.h
@@ -41,7 +41,6 @@
// samples maintained by the SampleRecorder. Type T defines the sampled data.
template <typename T>
struct Sample {
- public:
// Guards the ability to restore the sample to a pristine state. This
// prevents races with sampling and resurrecting an object.
absl::Mutex init_mu;
diff --git a/absl/strings/cord.cc b/absl/strings/cord.cc
index 115705a..29af978 100644
--- a/absl/strings/cord.cc
+++ b/absl/strings/cord.cc
@@ -708,8 +708,8 @@
if (btree_enabled()) {
// TODO(b/192061034): keep legacy 10% growth rate: consider other rates.
rep = ForceBtree(rep);
- const size_t alloc_hint = (std::min)(kMaxFlatLength, rep->length / 10);
- rep = CordRepBtree::Append(rep->btree(), src, alloc_hint);
+ const size_t min_growth = std::max<size_t>(rep->length / 10, src.size());
+ rep = CordRepBtree::Append(rep->btree(), src, min_growth - src.size());
} else {
// Use new block(s) for any remaining bytes that were not handled above.
// Alloc extra memory only if the right child of the root of the new tree
diff --git a/absl/strings/internal/cord_rep_btree.cc b/absl/strings/internal/cord_rep_btree.cc
index 8fe589f..6d53ab6 100644
--- a/absl/strings/internal/cord_rep_btree.cc
+++ b/absl/strings/internal/cord_rep_btree.cc
@@ -96,7 +96,8 @@
maybe_dump_data(rep);
DumpAll(substring->child, include_contents, stream, depth + 1);
} else if (rep->tag >= FLAT) {
- stream << "Flat, len = " << rep->length;
+ stream << "Flat, len = " << rep->length
+ << ", cap = " << rep->flat()->Capacity();
maybe_dump_data(rep);
} else if (rep->tag == EXTERNAL) {
stream << "Extn, len = " << rep->length;
diff --git a/absl/time/time.h b/absl/time/time.h
index e9cbce8..5abd815 100644
--- a/absl/time/time.h
+++ b/absl/time/time.h
@@ -480,8 +480,9 @@
// ToInt64Hours()
//
// Helper functions that convert a Duration to an integral count of the
-// indicated unit. These functions are shorthand for the `IDivDuration()`
-// function above; see its documentation for details about overflow, etc.
+// indicated unit. These return the same results as the `IDivDuration()`
+// function, though they usually do so more efficiently; see the
+// documentation of `IDivDuration()` for details about overflow, etc.
//
// Example:
//