diff options
| author | luwenpeng <[email protected]> | 2024-08-12 15:32:37 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2024-08-12 15:32:37 +0800 |
| commit | 0414710399c7ff64b3ea0128cc39dc4d37d6e0a7 (patch) | |
| tree | 218070dda1eb1629d2de9ebe054ecba0ca1900b6 | |
| parent | 8054b9c032393ed567aaacb902562e7fd084a866 (diff) | |
optimizate: session table support overwrite HASH_INITIAL_NUM_BUCKETS
| -rw-r--r-- | deps/uthash/uthash.h | 2 | ||||
| -rw-r--r-- | src/session/session_table.cpp | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/deps/uthash/uthash.h b/deps/uthash/uthash.h index 68693bf..9572e48 100644 --- a/deps/uthash/uthash.h +++ b/deps/uthash/uthash.h @@ -129,7 +129,9 @@ do { #endif /* initial number of buckets */ +#ifndef HASH_INITIAL_NUM_BUCKETS #define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */ +#endif #define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */ #define HASH_BKT_CAPACITY_THRESH 10U /* expand when bucket count reaches */ diff --git a/src/session/session_table.cpp b/src/session/session_table.cpp index 1d40421..e396996 100644 --- a/src/session/session_table.cpp +++ b/src/session/session_table.cpp @@ -1,5 +1,6 @@ #include <assert.h> +#define HASH_INITIAL_NUM_BUCKETS 32768U // initial number of buckets #define HASH_FUNCTION(keyptr, keylen, hashv) HASH_FUNCTION_OVERWRITE(keyptr, keylen, &hashv) #define HASH_KEYCMP(a, b, len) HASH_KEYCMP_OVERWRITE(a, b, len) #include "session_def.h" |
