From 6a093738d55aeaa306df2ad0e05da09a09bfaafc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 14 Sep 2009 20:10:28 +0200 Subject: increase hash table size --- mutrace.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mutrace.c b/mutrace.c index e02a011..4375e4d 100644 --- a/mutrace.c +++ b/mutrace.c @@ -49,7 +49,7 @@ struct mutex_info { struct mutex_info *next; }; -static unsigned long hash_size = 557; +static unsigned long hash_size = 3371; /* probably a good idea to pick a prime here */ static unsigned long frames_max = 16; static volatile unsigned n_broken = 0; @@ -179,11 +179,8 @@ static unsigned long mutex_hash(pthread_mutex_t *mutex) { unsigned long u; u = (unsigned long) mutex; - do { - u = (u % hash_size) ^ (u / hash_size); - } while (u > hash_size); - - return u; + u /= sizeof(void*); + return u % hash_size; } static void lock_hash_mutex(unsigned u) { -- cgit