aboutsummaryrefslogtreecommitdiff
path: root/absl/container/internal/node_slot_policy.h
diff options
context:
space:
mode:
authorEvan Brown <ezb@google.com>2023-09-12 09:14:32 -0700
committerCopybara-Service <copybara-worker@google.com>2023-09-12 09:15:26 -0700
commit5ae23ed130027e2376e0868ec4bb4fa358b7e238 (patch)
tree0e7cf0c8c3444ef0a620627a3eb9f528f202c586 /absl/container/internal/node_slot_policy.h
parentf01b1b56de359de540c97a7898ff3011c47e2c26 (diff)
downloadabseil-5ae23ed130027e2376e0868ec4bb4fa358b7e238.tar.gz
abseil-5ae23ed130027e2376e0868ec4bb4fa358b7e238.tar.bz2
abseil-5ae23ed130027e2376e0868ec4bb4fa358b7e238.zip
Make PolicyTraits::transfer_uses_memcpy() true for node_hash_* tables.
This should enable binary size savings for now and more efficiency improvements with small buffer optimization. PiperOrigin-RevId: 564741270 Change-Id: Icf204d88256243eb60464439a52dd589d7a559cb
Diffstat (limited to 'absl/container/internal/node_slot_policy.h')
-rw-r--r--absl/container/internal/node_slot_policy.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/absl/container/internal/node_slot_policy.h b/absl/container/internal/node_slot_policy.h
index baba5743..3f1874d4 100644
--- a/absl/container/internal/node_slot_policy.h
+++ b/absl/container/internal/node_slot_policy.h
@@ -62,9 +62,12 @@ struct node_slot_policy {
Policy::delete_element(alloc, *slot);
}
+ // Returns true_type to indicate that transfer can use memcpy.
template <class Alloc>
- static void transfer(Alloc*, slot_type* new_slot, slot_type* old_slot) {
+ static std::true_type transfer(Alloc*, slot_type* new_slot,
+ slot_type* old_slot) {
*new_slot = *old_slot;
+ return {};
}
static size_t space_used(const slot_type* slot) {