Add hash table for default hasher
Release / release (push) Successful in 3s

This commit is contained in:
Abdelrahman Said
2026-09-23 00:21:51 +01:00
parent c215486442
commit 20e890964f
+7 -5
View File
@@ -19,6 +19,7 @@
#define TABLE_H #define TABLE_H
#include "../hasher/hasher.h" #include "../hasher/hasher.h"
#include "../hasher/murmur3.h"
#include "../../array/array.h" #include "../../array/array.h"
#include "../../mem/allocator/mem_allocator.h" #include "../../mem/allocator/mem_allocator.h"
#include "../../stream/stream.h" #include "../../stream/stream.h"
@@ -29,11 +30,12 @@
BEGIN_C_LINKAGE BEGIN_C_LINKAGE
#endif // !WP_PLATFORM_CPP #endif // !WP_PLATFORM_CPP
#define WP_HASH_TABLE_MAGIC wpU64Const(0x57504854424c) #define WP_HASH_TABLE_MAGIC wpU64Const(0x57504854424c)
#define WP_HASH_TAG_BITS wpU64Const(32) #define WP_HASH_TAG_BITS wpU64Const(32)
#define WP_HASH_DIST_INC (wpU64Const(1) << WP_HASH_TAG_BITS) #define WP_HASH_DIST_INC (wpU64Const(1) << WP_HASH_TAG_BITS)
#define WP_HASH_TAG_MASK (WP_HASH_DIST_INC - wpU64Const(1)) #define WP_HASH_TAG_MASK (WP_HASH_DIST_INC - wpU64Const(1))
#define WP_HASH_MAX_LOAD_FACTOR 0.65f #define WP_HASH_MAX_LOAD_FACTOR 0.65f
#define WP_HASH_TABLE_DEFAULT_HASHER wpX64Mur3Hasher()
typedef WpU8Stream (*WpU8StreamEncoder)(void *data); typedef WpU8Stream (*WpU8StreamEncoder)(void *data);
typedef b8 (*WpKeyEqualTest)(void *a, void *b); typedef b8 (*WpKeyEqualTest)(void *a, void *b);