From: Philippe Waroquiers Date: Thu, 17 Jan 2013 23:57:35 +0000 (+0000) Subject: Change the size of the hash table used to cache IP -> debuginfo to a prime nr X-Git-Tag: svn/VALGRIND_3_9_0~444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac3eaed23728bb9268b933a24abfc7071a99d66a;p=thirdparty%2Fvalgrind.git Change the size of the hash table used to cache IP -> debuginfo to a prime nr This change is based on rumours/legends/oral transmission of experience/... that prime nrs are good to use for hash table size :). If someone has a (short) explanation about why this is useful, that will be welcome. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13237 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 95e1ea0409..0a4232550c 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -2245,7 +2245,8 @@ static void find_DiCfSI ( /*OUT*/DebugInfo** diP, records are added all at once, when the debuginfo for an object is read, and is not changed ever thereafter. */ -#define N_CFSI_CACHE 511 +// Prime number, giving about 3K cache on 32 bits, 6K cache on 64 bits. +#define N_CFSI_CACHE 509 typedef struct { Addr ip; DebugInfo* di; Word ix; }