class HashSetResizeHelper

Defined at line 1634 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h

Helper class to perform resize of the hash set.

It contains special optimizations for small group resizes.

See GrowIntoSingleGroupShuffleControlBytes for details.

Public Methods

void HashSetResizeHelper (CommonFields & c)

Defined at line 1636 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h

FindInfo FindFirstNonFullAfterResize (const CommonFields & c, size_t old_capacity, size_t hash)

Optimized for small groups version of `find_first_non_full`.

Beneficial only right after calling `raw_hash_set::resize`.

It is safe to call in case capacity is big or was not changed, but there

will be no performance benefit.

It has implicit assumption that `resize` will call

`GrowSizeIntoSingleGroup*` in case `IsGrowingIntoSingleGroupApplicable`.

Falls back to `find_first_non_full` in case of big groups, so it is

safe to use after `rehash_and_grow_if_necessary`.

Defined at line 1649 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h

ctrl_t * old_ctrl ()

Defined at line 1670 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h

size_t old_capacity ()

Defined at line 1671 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h

template <typename Alloc, size_t SizeOfSlot, bool TransferUsesMemcpy, size_t AlignOfSlot>
bool InitializeSlots (CommonFields & c, void * old_slots, Alloc alloc)

Allocates a backing array for the hashtable.

Reads `capacity` and updates all other fields based on the result of

the allocation.

It also may do the folowing actions:

1. initialize control bytes

2. initialize slots

3. deallocate old slots.

We are bundling a lot of functionality

in one ABSL_ATTRIBUTE_NOINLINE function in order to minimize binary code

duplication in raw_hash_set

<

>::resize.

`c.capacity()` must be nonzero.

POSTCONDITIONS:

1. CommonFields is initialized.

if IsGrowingIntoSingleGroupApplicable

&

&

TransferUsesMemcpy

Both control bytes and slots are fully initialized.

old_slots are deallocated.

infoz.RecordRehash is called.

if IsGrowingIntoSingleGroupApplicable

&

&

!TransferUsesMemcpy

Control bytes are fully initialized.

infoz.RecordRehash is called.

GrowSizeIntoSingleGroup must be called to finish slots initialization.

if !IsGrowingIntoSingleGroupApplicable

Control bytes are initialized to empty table via ResetCtrl.

raw_hash_set

<

>::resize must insert elements regularly.

infoz.RecordRehash is called if old_capacity == 0.

Returns IsGrowingIntoSingleGroupApplicable result to avoid recomputation.

Defined at line 1708 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h

template <class PolicyTraits, class Alloc>
void GrowSizeIntoSingleGroup (CommonFields & c, Alloc & alloc_ref, typename PolicyTraits::slot_type * old_slots)

Relocates slots into new single group consistent with

GrowIntoSingleGroupShuffleControlBytes.

PRECONDITIONS:

1. GrowIntoSingleGroupShuffleControlBytes was already called.

Defined at line 1766 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h

template <size_t AlignOfSlot, class CharAlloc>
void DeallocateOld (CharAlloc alloc_ref, size_t slot_size, void * old_slots)

Deallocates old backing array.

Defined at line 1788 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h