Go to the documentation of this file.
66 #include "../internal.h"
115 if (
ret->buckets == NULL) {
157 if (out_hash != NULL) {
163 if (call_cmp_func(lh->
comp,
cur->data,
data) == 0) {
176 int (*cmp_key)(
const void *
key,
177 const void *
value)) {
180 if (cmp_key(
key,
cur->data) == 0) {
194 return *next_ptr == NULL ? NULL : (*next_ptr)->
data;
199 int (*cmp_key)(
const void *
key,
200 const void *
value)) {
202 return *next_ptr == NULL ? NULL : (*next_ptr)->
data;
210 size_t i, alloc_size;
212 alloc_size =
sizeof(
LHASH_ITEM *) * new_num_buckets;
213 if (alloc_size /
sizeof(
LHASH_ITEM*) != new_num_buckets) {
218 if (new_buckets == NULL) {
225 const size_t new_bucket =
cur->hash % new_num_buckets;
227 cur->next = new_buckets[new_bucket];
228 new_buckets[new_bucket] =
cur;
240 size_t avg_chain_length;
251 const size_t new_num_buckets = lh->
num_buckets * 2;
279 if (*next_ptr != NULL) {
282 *old_data = (*next_ptr)->data;
283 (*next_ptr)->data =
data;
311 if (*next_ptr == NULL) {
317 *next_ptr = item->
next;
void * OPENSSL_lh_retrieve_key(const _LHASH *lh, const void *key, uint32_t key_hash, int(*cmp_key)(const void *key, const void *value))
static LHASH_ITEM ** get_next_ptr_and_hash(const _LHASH *lh, uint32_t *out_hash, const void *data, lhash_hash_func_helper call_hash_func, lhash_cmp_func_helper call_cmp_func)
void * OPENSSL_lh_retrieve(const _LHASH *lh, const void *data, lhash_hash_func_helper call_hash_func, lhash_cmp_func_helper call_cmp_func)
struct lhash_item_st * next
void OPENSSL_lh_free(_LHASH *lh)
static void * OPENSSL_memset(void *dst, int c, size_t n)
_LHASH * OPENSSL_lh_new(lhash_hash_func hash, lhash_cmp_func comp)
int OPENSSL_lh_insert(_LHASH *lh, void **old_data, void *data, lhash_hash_func_helper call_hash_func, lhash_cmp_func_helper call_cmp_func)
int(* lhash_cmp_func_helper)(lhash_cmp_func func, const void *a, const void *b)
static const size_t kMinAverageChainLength
static LHASH_ITEM ** get_next_ptr_by_key(const _LHASH *lh, const void *key, uint32_t key_hash, int(*cmp_key)(const void *key, const void *value))
static const size_t kMaxAverageChainLength
uint32_t(* lhash_hash_func)(const void *a)
static const size_t kMinNumBuckets
void OPENSSL_lh_doall_arg(_LHASH *lh, void(*func)(void *, void *), void *arg)
UniquePtr< SSL_SESSION > ret
AllocList * next[kMaxLevel]
size_t OPENSSL_lh_num_items(const _LHASH *lh)
static void lh_rebucket(_LHASH *lh, const size_t new_num_buckets)
int(* lhash_cmp_func)(const void *a, const void *b)
uint32_t(* lhash_hash_func_helper)(lhash_hash_func func, const void *a)
void * OPENSSL_lh_delete(_LHASH *lh, const void *data, lhash_hash_func_helper call_hash_func, lhash_cmp_func_helper call_cmp_func)
struct lhash_item_st LHASH_ITEM
static void lh_maybe_resize(_LHASH *lh)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:28