]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Jack up the size of the translation cache from 16 MB to 40 MB (!).
authorJulian Seward <jseward@acm.org>
Thu, 2 May 2002 03:47:01 +0000 (03:47 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 2 May 2002 03:47:01 +0000 (03:47 +0000)
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

coregrind/vg_transtab.c
vg_transtab.c

index bbd5e83327cb740588c753fc0413dbbeaaa794ea..0ef2be20a2f4dd1c6cccf55a3491c541cddb00ff 100644 (file)
@@ -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 @@ void VG_(maybe_do_lru_pass) ( void )
    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)
index bbd5e83327cb740588c753fc0413dbbeaaa794ea..0ef2be20a2f4dd1c6cccf55a3491c541cddb00ff 100644 (file)
@@ -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 @@ void VG_(maybe_do_lru_pass) ( void )
    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)