From 9b471e72d75c154f3b8c4fa134c7c9f1a55fe27f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 27 Apr 2023 17:09:00 +0200 Subject: 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. --- lib/hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/hash.h') diff --git a/lib/hash.h b/lib/hash.h index 8febb33f..b30f7830 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -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); -- cgit v1.2.3