@@ -31,6 +31,32 @@ struct sys_hashmap_oa_lp_data {
3131 size_t n_tombstones ;
3232};
3333
34+ /**
35+ * @brief Declare a Open Addressing Linear Probe Hashmap
36+ *
37+ * Declare a Open Addressing Linear Probe Hashmap
38+ *
39+ * @param _name Name of the Hashmap.
40+ */
41+ #define SYS_HASHMAP_OA_LP_DECLARE (_name ) \
42+ SYS_HASHMAP_DECLARE_ADVANCED(_name, sys_hashmap_config, sys_hashmap_oa_lp_data)
43+
44+ /**
45+ * @brief Init a Open Addressing Linear Probe Hashmap (advanced)
46+ *
47+ * Init a Open Addressing Linear Probe Hashmap with control over advanced parameters.
48+ *
49+ * @note The allocator @p _alloc is used for allocating internal Hashmap
50+ * entries and does not interact with any user-provided keys or values.
51+ *
52+ * @param _name Name of the Hashmap.
53+ * @param _hash_func Hash function pointer of type @ref sys_hash_func32_t.
54+ * @param _alloc_func Allocator function pointer of type @ref sys_hashmap_allocator_t.
55+ * @param ... Variant-specific details for @ref sys_hashmap_config.
56+ */
57+ #define SYS_HASHMAP_OA_LP_INIT_ADVANCED (_name , _hash_func , _alloc_func , _max_size , _load_factor ) \
58+ SYS_HASHMAP_INIT_ADVANCED(_name, &sys_hashmap_oa_lp_api, _hash_func, _alloc_func, _max_size, _load_factor)
59+
3460/**
3561 * @brief Declare a Open Addressing Linear Probe Hashmap (advanced)
3662 *
@@ -91,8 +117,11 @@ struct sys_hashmap_oa_lp_data {
91117 SYS_HASHMAP_CONFIG(SIZE_MAX, SYS_HASHMAP_DEFAULT_LOAD_FACTOR))
92118
93119#ifdef CONFIG_SYS_HASH_MAP_CHOICE_OA_LP
120+ #define SYS_HASHMAP_DEFAULT_DECLARE (_name ) SYS_HASHMAP_OA_LP_DECLARE(_name)
94121#define SYS_HASHMAP_DEFAULT_DEFINE (_name ) SYS_HASHMAP_OA_LP_DEFINE(_name)
95122#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC (_name ) SYS_HASHMAP_OA_LP_DEFINE_STATIC(_name)
123+ #define SYS_HASHMAP_DEFAULT_INIT_ADVANCED (_name , _hash_func , _alloc_func , _max_size , _load_factor ) \
124+ SYS_HASHMAP_OA_LP_INIT_ADVANCED(_name, _hash_func, _alloc_func, _max_size, _load_factor)
96125#define SYS_HASHMAP_DEFAULT_DEFINE_ADVANCED (_name , _hash_func , _alloc_func , ...) \
97126 SYS_HASHMAP_OA_LP_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, __VA_ARGS__)
98127#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC_ADVANCED (_name , _hash_func , _alloc_func , ...) \
0 commit comments