Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sys_hashmap_config Struct Reference

Generic Hashmap configuration. More...

#include <hash_map_api.h>

Data Fields

size_t max_size
 Maximum number of entries.
 
uint8_t load_factor
 Maximum load factor expressed in hundredths.
 
uint8_t initial_n_buckets
 Initial number of buckets to allocate.
 

Detailed Description

Generic Hashmap configuration.

When there is a known limit imposed on the number of entries in the Hashmap, users should specify that via max_size. When the Hashmap should have no artificial limitation in size (and be bounded only by the provided allocator), users should specify SIZE_MAX here.

The load_factor is defined as the size of the Hashmap divided by the number of buckets. In this case, the size of the Hashmap is defined as the number of valid entries plus the number of invalidated entries.

The initial_n_buckets is defined as the number of buckets to allocate when moving from size 0 to size 1 such that the maximum load_factor property is preserved.

Field Documentation

◆ initial_n_buckets

uint8_t sys_hashmap_config::initial_n_buckets

Initial number of buckets to allocate.

◆ load_factor

uint8_t sys_hashmap_config::load_factor

Maximum load factor expressed in hundredths.

◆ max_size

size_t sys_hashmap_config::max_size

Maximum number of entries.


The documentation for this struct was generated from the following file: