Author: njn
Date: 2007-11-02 04:12:48 +0000 (Fri, 02 Nov 2007)
New Revision: 7080

Log:
Fix 64-bit Massif breakage, caused by problems with integer arithmetic on
values of different signs and sizes that only a C language lawyer would
spot.

Modified:
   trunk/massif/ms_main.c


Modified: trunk/massif/ms_main.c
===================================================================
--- trunk/massif/ms_main.c      2007-11-01 18:58:46 UTC (rev 7079)
+++ trunk/massif/ms_main.c      2007-11-02 04:12:48 UTC (rev 7080)
@@ -395,7 +395,11 @@
 }
 
 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%


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to