diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2023-04-27 17:09:00 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2023-04-27 17:09:00 +0200 |
commit | 9b471e72d75c154f3b8c4fa134c7c9f1a55fe27f (patch) | |
tree | 9b48f388f4d3f87d243d8a9df1adfcddf75a7a2e /lib | |
parent | ca0f239c72486cebfe171e335e3b8a86f5999714 (diff) |
Conf: Fix symbol lookup
The symbol table used just symbol name as a key, and used a trick with
active flag to find symbols in active scopes with one hash table lookup.
The disadvantage is that it can degenerate to O(n) for negative queries
in situations where are many symbols with the same name in different
scopes.
Thanks to Yanko Kaneti for the bugreport.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hash.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -237,7 +237,7 @@ mem_hash(const void *p, uint s) } static inline uint -ptr_hash(void *ptr) +ptr_hash(const void *ptr) { uintptr_t p = (uintptr_t) ptr; return p ^ (p << 8) ^ (p >> 16); |