Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hash_map_oa_lp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Meta
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
15#ifndef ZEPHYR_INCLUDE_SYS_HASH_MAP_OA_LP_H_
16#define ZEPHYR_INCLUDE_SYS_HASH_MAP_OA_LP_H_
17
18#include <stddef.h>
19
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
28 void *buckets;
29 size_t n_buckets;
30 size_t size;
32};
33
47#define SYS_HASHMAP_OA_LP_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...) \
48 SYS_HASHMAP_DEFINE_ADVANCED(_name, &sys_hashmap_oa_lp_api, sys_hashmap_config, \
49 sys_hashmap_oa_lp_data, _hash_func, _alloc_func, __VA_ARGS__)
50
64#define SYS_HASHMAP_OA_LP_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...) \
65 SYS_HASHMAP_DEFINE_STATIC_ADVANCED(_name, &sys_hashmap_oa_lp_api, sys_hashmap_config, \
66 sys_hashmap_oa_lp_data, _hash_func, _alloc_func, \
67 __VA_ARGS__)
68
76#define SYS_HASHMAP_OA_LP_DEFINE_STATIC(_name) \
77 SYS_HASHMAP_OA_LP_DEFINE_STATIC_ADVANCED( \
78 _name, sys_hash32, SYS_HASHMAP_DEFAULT_ALLOCATOR, \
79 SYS_HASHMAP_CONFIG(SIZE_MAX, SYS_HASHMAP_DEFAULT_LOAD_FACTOR))
80
88#define SYS_HASHMAP_OA_LP_DEFINE(_name) \
89 SYS_HASHMAP_OA_LP_DEFINE_ADVANCED( \
90 _name, sys_hash32, SYS_HASHMAP_DEFAULT_ALLOCATOR, \
91 SYS_HASHMAP_CONFIG(SIZE_MAX, SYS_HASHMAP_DEFAULT_LOAD_FACTOR))
92
93#ifdef CONFIG_SYS_HASH_MAP_CHOICE_OA_LP
94#define SYS_HASHMAP_DEFAULT_DEFINE(_name) SYS_HASHMAP_OA_LP_DEFINE(_name)
95#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC(_name) SYS_HASHMAP_OA_LP_DEFINE_STATIC(_name)
96#define SYS_HASHMAP_DEFAULT_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...) \
97 SYS_HASHMAP_OA_LP_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, __VA_ARGS__)
98#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...) \
99 SYS_HASHMAP_OA_LP_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, __VA_ARGS__)
100#endif
101
102extern const struct sys_hashmap_api sys_hashmap_oa_lp_api;
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* ZEPHYR_INCLUDE_SYS_HASH_MAP_OA_LP_H_ */
const struct sys_hashmap_api sys_hashmap_oa_lp_api
Generic Hashmap API.
Definition hash_map_api.h:168
Definition hash_map_oa_lp.h:27
size_t size
Definition hash_map_oa_lp.h:30
size_t n_tombstones
Definition hash_map_oa_lp.h:31
void * buckets
Definition hash_map_oa_lp.h:28
size_t n_buckets
Definition hash_map_oa_lp.h:29