Go to the documentation of this file.
39 #ifndef ABSL_CONTAINER_INTERNAL_HASHTABLEZ_SAMPLER_H_
40 #define ABSL_CONTAINER_INTERNAL_HASHTABLEZ_SAMPLER_H_
47 #include "absl/base/config.h"
48 #include "absl/base/internal/per_thread_tls.h"
49 #include "absl/base/optimization.h"
51 #include "absl/synchronization/mutex.h"
52 #include "absl/utility/utility.h"
56 namespace container_internal {
99 #ifdef ABSL_INTERNAL_HAVE_SSE2
100 total_probe_length /= 16;
102 total_probe_length /= 8;
105 info->
num_erases.store(0, std::memory_order_relaxed);
110 std::memory_order_relaxed);
114 size_t target_capacity) {
118 std::memory_order_relaxed);
122 info->
max_reserve.store(0, std::memory_order_relaxed);
127 info->
size.store(
size, std::memory_order_relaxed);
132 info->
num_erases.store(0, std::memory_order_relaxed);
137 size_t distance_from_desired);
140 info->
size.fetch_sub(1, std::memory_order_relaxed);
144 1 + info->
num_erases.load(std::memory_order_relaxed),
145 std::memory_order_relaxed);
156 size_t inline_element_size);
159 #if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
160 #error ABSL_INTERNAL_HASHTABLEZ_SAMPLE cannot be directly set
161 #endif // defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
163 #if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
222 friend class HashtablezInfoHandlePeer;
223 HashtablezInfo*
info_;
243 #endif // defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
245 #if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
247 #endif // defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
253 #if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
258 SampleSlow(global_next_sample, inline_element_size));
261 #endif // !ABSL_PER_THREAD_TLS
299 #endif // ABSL_CONTAINER_INTERNAL_HASHTABLEZ_SAMPLER_H_
#define ABSL_PREDICT_FALSE(x)
void SetHashtablezMaxSamples(int32_t max)
void * stack[kMaxStackDepth]
int32_t GetHashtablezMaxSamples()
std::atomic< size_t > num_erases
void SetHashtablezEnabled(bool enabled)
::absl::profiling_internal::SampleRecorder< HashtablezInfo > HashtablezSampler
#define ABSL_ATTRIBUTE_UNUSED
static constexpr int kMaxStackDepth
void RecordClearedReservation()
void RecordRehashSlow(HashtablezInfo *info, size_t total_probe_length)
std::atomic< size_t > max_reserve
bool IsHashtablezEnabled()
void RecordClearedReservationSlow(HashtablezInfo *info)
void RecordReservation(size_t)
friend void swap(HashtablezInfoHandle &, HashtablezInfoHandle &)
HashtablezInfo * SampleSlow(SamplingState &next_sample, size_t inline_element_size)
#define ABSL_NAMESPACE_END
void RecordStorageChangedSlow(HashtablezInfo *info, size_t size, size_t capacity)
std::atomic< size_t > hashes_bitwise_or
experimental::ClientRpcInfo * info_
bool ABSL_INTERNAL_C_SYMBOL() AbslContainerInternalSampleEverything()
#define ABSL_NAMESPACE_BEGIN
std::atomic< size_t > hashes_bitwise_and
std::atomic< size_t > capacity
#define ABSL_EXCLUSIVE_LOCKS_REQUIRED(...)
size_t inline_element_size
std::atomic< size_t > num_rehashes
std::atomic< size_t > size
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
HashtablezInfoHandle()=default
#define ABSL_PER_THREAD_TLS_KEYWORD
std::atomic< size_t > max_probe_length
#define ABSL_INTERNAL_C_SYMBOL(x)
void SetHashtablezMaxSamplesInternal(int32_t max)
void SetHashtablezSampleParameter(int32_t rate)
#define ABSL_PREDICT_TRUE(x)
int32_t GetHashtablezSampleParameter()
void SetHashtablezEnabledInternal(bool enabled)
void SetHashtablezConfigListener(HashtablezConfigListener l)
void RecordInsert(size_t, size_t)
HashtablezSampler & GlobalHashtablezSampler()
std::atomic< size_t > hashes_bitwise_xor
void RecordRehash(size_t)
HashtablezInfoHandle Sample(size_t inline_element_size ABSL_ATTRIBUTE_UNUSED)
void RecordReservationSlow(HashtablezInfo *info, size_t target_capacity)
void RecordInsertSlow(HashtablezInfo *info, size_t hash, size_t distance_from_desired)
HashtablezInfoHandle(std::nullptr_t)
HashtablezInfo & operator=(const HashtablezInfo &)=delete
void RecordEraseSlow(HashtablezInfo *info)
void(*)() HashtablezConfigListener
void SetHashtablezSampleParameterInternal(int32_t rate)
void PrepareForSampling() ABSL_EXCLUSIVE_LOCKS_REQUIRED(init_mu)
T exchange(T &obj, U &&new_value)
void UnsampleSlow(HashtablezInfo *info)
std::atomic< size_t > total_probe_length
void RecordStorageChanged(size_t, size_t)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:01