Jack up the size of the translation cache from 16 MB to 40 MB (!).
This is needed to give reasonable behaviour for the insanity of a
Mozilla debug build, apparently even worse than the insanity of a
KDE 3 debug build. Change some limit calculations to use double
rather than int, so as to avoid overflows.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@193 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/vg_transtab.c b/vg_transtab.c
index bbd5e83..0ef2be2 100644
--- a/vg_transtab.c
+++ b/vg_transtab.c
@@ -42,7 +42,7 @@
of code retranslation. */
/* Size of the translation cache, in bytes. */
-#define VG_TC_SIZE 16000000
+#define VG_TC_SIZE /*16000000*/ /*32000000*/ 40000000
/* Do a LRU pass when the translation cache becomes this full. */
#define VG_TC_LIMIT_PERCENT 95
@@ -52,7 +52,7 @@
/* Number of entries in the translation table. This must be a prime
number in order to make the hashing work properly. */
-#define VG_TT_SIZE /*19997*/ /*29989*/ /*50497*/ /*75083*/ 100129
+#define VG_TT_SIZE /*100129*/ /*200191*/ 250829
/* Do an LRU pass when the translation table becomes this full. */
#define VG_TT_LIMIT_PERCENT /*67*/ 80
@@ -122,10 +122,14 @@
Int i, j, r, w, thresh, ttno;
TTEntry* tte;
- const Int tc_limit = (Int)((VG_TC_SIZE * VG_TC_LIMIT_PERCENT) / 100.0);
- const Int tt_limit = (Int)((VG_TT_SIZE * VG_TT_LIMIT_PERCENT) / 100.0);
- const Int tc_target = (Int)((VG_TC_SIZE * VG_TC_TARGET_PERCENT) / 100.0);
- const Int tt_target = (Int)((VG_TT_SIZE * VG_TT_TARGET_PERCENT) / 100.0);
+ const Int tc_limit = (Int)(((double)VG_TC_SIZE * (double)VG_TC_LIMIT_PERCENT)
+ / (double)100.0);
+ const Int tt_limit = (Int)(((double)VG_TT_SIZE * (double)VG_TT_LIMIT_PERCENT)
+ / (double)100.0);
+ const Int tc_target = (Int)(((double)VG_TC_SIZE * (double)VG_TC_TARGET_PERCENT)
+ / (double)100.0);
+ const Int tt_target = (Int)(((double)VG_TT_SIZE * (double)VG_TT_TARGET_PERCENT)
+ / (double)100.0);
/* Decide quickly if we need to do an LRU pass ? */
if (vg_tc_used <= tc_limit && vg_tt_used <= tt_limit)