mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 00:50:38 +08:00
manually merge some changes from abseil-cpp
This commit is contained in:
Vendored
+4
-3
@@ -2856,6 +2856,7 @@ class node_handle<Policy, PolicyTraits, Alloc,
|
||||
: public node_handle_base<PolicyTraits, Alloc>
|
||||
{
|
||||
using Base = node_handle_base<PolicyTraits, Alloc>;
|
||||
using slot_type = typename PolicyTraits::slot_type;
|
||||
|
||||
public:
|
||||
using key_type = typename Policy::key_type;
|
||||
@@ -3888,7 +3889,7 @@ public:
|
||||
constexpr size_t Offset() const {
|
||||
static_assert(N < NumOffsets, "Index out of bounds");
|
||||
return adl_barrier::Align(
|
||||
Offset<N - 1>() + SizeOf<ElementType<N - 1>>() * size_[N - 1],
|
||||
Offset<N - 1>() + SizeOf<ElementType<N - 1>>::value * size_[N - 1],
|
||||
ElementAlignment<N>::value);
|
||||
}
|
||||
|
||||
@@ -4081,7 +4082,7 @@ public:
|
||||
constexpr size_t AllocSize() const {
|
||||
static_assert(NumTypes == NumSizes, "You must specify sizes of all fields");
|
||||
return Offset<NumTypes - 1>() +
|
||||
SizeOf<ElementType<NumTypes - 1>>() * size_[NumTypes - 1];
|
||||
SizeOf<ElementType<NumTypes - 1>>::value * size_[NumTypes - 1];
|
||||
}
|
||||
|
||||
// If built with --config=asan, poisons padding bytes (if any) in the
|
||||
@@ -4105,7 +4106,7 @@ public:
|
||||
// The `if` is an optimization. It doesn't affect the observable behaviour.
|
||||
if (ElementAlignment<N - 1>::value % ElementAlignment<N>::value) {
|
||||
size_t start =
|
||||
Offset<N - 1>() + SizeOf<ElementType<N - 1>>() * size_[N - 1];
|
||||
Offset<N - 1>() + SizeOf<ElementType<N - 1>>::value * size_[N - 1];
|
||||
ASAN_POISON_MEMORY_REGION(p + start, Offset<N>() - start);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user