From: Willy Tarreau Date: Wed, 7 Sep 2022 09:27:25 +0000 (+0200) Subject: CLEANUP: activity: make taskprof use ptr_hash() X-Git-Tag: v2.7-dev6~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c1bc01f319faa2b2c2d96ceba4eb9a8f8505083;p=thirdparty%2Fhaproxy.git CLEANUP: activity: make taskprof use ptr_hash() There's no more point using a different hash function here, xxh64 is of course better distributed but we really don't care so let's unify the code. --- diff --git a/src/activity.c b/src/activity.c index 67c1017b72..ee00e0c935 100644 --- a/src/activity.c +++ b/src/activity.c @@ -21,7 +21,6 @@ #include #include #include -#include /* CLI context for the "show profiling" command */ struct show_prof_ctx { @@ -532,14 +531,10 @@ static int cmp_memprof_addr(const void *a, const void *b) */ struct sched_activity *sched_activity_entry(struct sched_activity *array, const void *func) { - uint64_t hash = XXH64_avalanche(XXH64_mergeRound((size_t)func, (size_t)func)); + uint32_t hash = ptr_hash(func, 8); struct sched_activity *ret; const void *old = NULL; - hash ^= (hash >> 32); - hash ^= (hash >> 16); - hash ^= (hash >> 8); - hash &= 0xff; ret = &array[hash]; if (likely(ret->func == func))