From: Nicholas Nethercote Date: Sun, 17 Jul 2005 23:12:33 +0000 (+0000) Subject: tweak X-Git-Tag: svn/VALGRIND_3_0_0~163 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ced59e1593f280dc45dc4146692153fe35cf647f;p=thirdparty%2Fvalgrind.git tweak git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4155 --- diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 2b96b927e5..2e9486f992 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -551,15 +551,15 @@ static UInt pszB_to_listNo ( SizeT pszB ) { vg_assert(0 == pszB % VG_MIN_MALLOC_SZB); - pszB /= VG_MIN_MALLOC_SZB; + SizeT n = pszB / VG_MIN_MALLOC_SZB; // The first 13 lists hold blocks of size VG_MIN_MALLOC_SZB * list_num. - // The final 4 hold bigger blocks. - if (pszB <= 12) return pszB; - if (pszB <= 16) return 13; - if (pszB <= 32) return 14; - if (pszB <= 64) return 15; - if (pszB <= 128) return 16; + // The final 5 hold bigger blocks. + if (n <= 12) return (UInt)n; + if (n <= 16) return 13; + if (n <= 32) return 14; + if (n <= 64) return 15; + if (n <= 128) return 16; return 17; }