Skip to content

Commit 89367c6

Browse files
ezbrcopybara-github
authored andcommitted
Rename CommonFields::slots_ptr to slot_array to match the name of the corresponding function in raw_hash_set.
PiperOrigin-RevId: 549379884 Change-Id: I305745dbea2c15821b2092441c9b4546fc7aabbe
1 parent 47d467e commit 89367c6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

absl/container/internal/raw_hash_set.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static inline void* PrevSlot(void* slot, size_t slot_size) {
140140
void DropDeletesWithoutResize(CommonFields& common,
141141
const PolicyFunctions& policy, void* tmp_space) {
142142
void* set = &common;
143-
void* slot_array = common.slots_ptr();
143+
void* slot_array = common.slot_array();
144144
const size_t capacity = common.capacity();
145145
assert(IsValidCapacity(capacity));
146146
assert(!is_small(capacity));
@@ -248,7 +248,7 @@ void ClearBackingArray(CommonFields& c, const PolicyFunctions& policy,
248248
c.infoz().RecordStorageChanged(0, c.capacity());
249249
} else {
250250
void* set = &c;
251-
(*policy.dealloc)(set, policy, c.backing_array_start(), c.slots_ptr(),
251+
(*policy.dealloc)(set, policy, c.backing_array_start(), c.slot_array(),
252252
c.capacity());
253253
c.set_control(EmptyGroup());
254254
c.set_generation_ptr(EmptyGeneration());

absl/container/internal/raw_hash_set.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ class CommonFields : public CommonFieldsGenerationInfo {
916916
// Explicitly copying fields into "this" and then resetting "that"
917917
// fields generates less code then calling absl::exchange per field.
918918
control_(that.control()),
919-
slots_(that.slots_ptr()),
919+
slots_(that.slot_array()),
920920
capacity_(that.capacity()),
921921
compressed_tuple_(that.size(), std::move(that.infoz())) {
922922
that.set_control(EmptyGroup());
@@ -935,7 +935,7 @@ class CommonFields : public CommonFieldsGenerationInfo {
935935
}
936936

937937
// Note: we can't use slots() because Qt defines "slots" as a macro.
938-
void* slots_ptr() const { return slots_; }
938+
void* slot_array() const { return slots_; }
939939
void set_slots(void* s) { slots_ = s; }
940940

941941
// The number of filled slots.
@@ -1302,7 +1302,7 @@ inline void ResetCtrl(CommonFields& common, size_t slot_size) {
13021302
std::memset(ctrl, static_cast<int8_t>(ctrl_t::kEmpty),
13031303
capacity + 1 + NumClonedBytes());
13041304
ctrl[capacity] = ctrl_t::kSentinel;
1305-
SanitizerPoisonMemoryRegion(common.slots_ptr(), slot_size * capacity);
1305+
SanitizerPoisonMemoryRegion(common.slot_array(), slot_size * capacity);
13061306
ResetGrowthLeft(common);
13071307
}
13081308

@@ -1315,7 +1315,7 @@ inline void SetCtrl(const CommonFields& common, size_t i, ctrl_t h,
13151315
const size_t capacity = common.capacity();
13161316
assert(i < capacity);
13171317

1318-
auto* slot_i = static_cast<const char*>(common.slots_ptr()) + i * slot_size;
1318+
auto* slot_i = static_cast<const char*>(common.slot_array()) + i * slot_size;
13191319
if (IsFull(h)) {
13201320
SanitizerUnpoisonMemoryRegion(slot_i, slot_size);
13211321
} else {
@@ -1374,7 +1374,7 @@ ABSL_ATTRIBUTE_NOINLINE void InitializeSlots(CommonFields& c, Alloc alloc) {
13741374
// a workaround while we plan the exact guarantee we want to provide.
13751375
const size_t sample_size =
13761376
(std::is_same<Alloc, std::allocator<char>>::value &&
1377-
c.slots_ptr() == nullptr)
1377+
c.slot_array() == nullptr)
13781378
? SizeOfSlot
13791379
: 0;
13801380

@@ -2708,7 +2708,7 @@ class raw_hash_set {
27082708

27092709
ctrl_t* control() const { return common().control(); }
27102710
slot_type* slot_array() const {
2711-
return static_cast<slot_type*>(common().slots_ptr());
2711+
return static_cast<slot_type*>(common().slot_array());
27122712
}
27132713
HashtablezInfoHandle& infoz() { return common().infoz(); }
27142714

0 commit comments

Comments
 (0)