diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-09-14 20:10:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-09-14 20:10:28 +0200 |
commit | 6a093738d55aeaa306df2ad0e05da09a09bfaafc (patch) | |
tree | b1a6f2ad1db77a536ca75b20124eb331d9b047ca | |
parent | f72f5986fd3766a0a31b9feed724dcaa878732ee (diff) |
increase hash table size
-rw-r--r-- | mutrace.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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) { |