]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix 64-bit Massif breakage, caused by problems with integer arithmetic on
authorNicholas Nethercote <njn@valgrind.org>
Fri, 2 Nov 2007 04:12:48 +0000 (04:12 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Fri, 2 Nov 2007 04:12:48 +0000 (04:12 +0000)
values of different signs and sizes that only a C language lawyer would
spot.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7080

massif/ms_main.c

index 97bf2eef9df1dda15c985348d6c51be5601d521b..953027126c0242da2c91c7e9286e34bf10154e55 100644 (file)
@@ -395,7 +395,11 @@ static Char* TimeUnit_to_string(TimeUnit time_unit)
 }
 
 static Bool clo_heap            = True;
-static UInt clo_heap_admin      = 8;
+   // clo_heap_admin is deliberately a word-sized type.  At one point it was
+   // a UInt, but this caused problems on 64-bit machines when it was
+   // multiplied by a small negative number and then promoted to a
+   // word-sized type -- it ended up with a value of 4.2 billion.  Sigh.
+static SizeT clo_heap_admin     = 8;
 static Bool clo_stacks          = False;
 static UInt clo_depth           = 30;
 static UInt clo_threshold       = 100;     // 100 == 1%