Merged r9101 (make Massif tests work if VG_MIN_MALLOC_SZB==16) from the
DARWIN branch, along with a few other minor things.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9197 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/massif/tests/peak.post.exp b/massif/tests/peak.post.exp
index 01f64c9..ad7afae 100644
--- a/massif/tests/peak.post.exp
+++ b/massif/tests/peak.post.exp
@@ -1,12 +1,12 @@
 --------------------------------------------------------------------------------
 Command:            ./peak
-Massif arguments:   --stacks=no --time-unit=B --peak-inaccuracy=0 --heap-admin=64 --massif-out-file=massif.out
+Massif arguments:   --stacks=no --time-unit=B --peak-inaccuracy=0 --heap-admin=128 --massif-out-file=massif.out
 ms_print arguments: massif.out
 --------------------------------------------------------------------------------
 
 
     KB
-16.95^                                                                       #
+33.89^                                                                       #
      |                                                                   .@  #
      |                                                                @  :@  #
      |                                                            @.  @  :@  #
@@ -27,7 +27,7 @@
      |      @.  @  :@  @:  @  @:  @  :@  @:  @  @:  @  :@  @:  @  @:  @  :@  #
      |   @  @:  @  :@  @:  @  @:  @  :@  @:  @  @:  @  :@  @:  @  @:  @  :@  #
    0 +----------------------------------------------------------------------->KB
-     0                                                                   19.69
+     0                                                                   39.38
 
 Number of snapshots: 81
  Detailed snapshots: [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79 (peak)]
@@ -36,243 +36,243 @@
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
   0              0                0                0             0            0
-  1            864              864              800            64            0
-  2            936              936              808           128            0
-  3            936              936              808           128            0
-86.32% (808B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->85.47% (800B) 0x........: main (peak.c:8)
+  1          1,728            1,728            1,600           128            0
+  2          1,872            1,872            1,616           256            0
+  3          1,872            1,872            1,616           256            0
+86.32% (1,616B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->85.47% (1,600B) 0x........: main (peak.c:8)
 | 
-->00.85% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.85% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
-  4          1,008              864              800            64            0
-  5          1,872            1,728            1,600           128            0
-  6          1,944            1,800            1,608           192            0
-  7          1,944            1,800            1,608           192            0
-89.33% (1,608B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->88.89% (1,600B) 0x........: main (peak.c:8)
+  4          2,016            1,728            1,600           128            0
+  5          3,744            3,456            3,200           256            0
+  6          3,888            3,600            3,216           384            0
+  7          3,888            3,600            3,216           384            0
+89.33% (3,216B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->88.89% (3,200B) 0x........: main (peak.c:8)
 | 
-->00.44% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.44% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
-  8          2,016            1,728            1,600           128            0
-  9          2,880            2,592            2,400           192            0
- 10          2,952            2,664            2,408           256            0
- 11          2,952            2,664            2,408           256            0
-90.39% (2,408B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->90.09% (2,400B) 0x........: main (peak.c:8)
+  8          4,032            3,456            3,200           256            0
+  9          5,760            5,184            4,800           384            0
+ 10          5,904            5,328            4,816           512            0
+ 11          5,904            5,328            4,816           512            0
+90.39% (4,816B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->90.09% (4,800B) 0x........: main (peak.c:8)
 | 
-->00.30% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.30% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 12          3,024            2,592            2,400           192            0
- 13          3,888            3,456            3,200           256            0
- 14          3,960            3,528            3,208           320            0
- 15          3,960            3,528            3,208           320            0
-90.93% (3,208B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->90.70% (3,200B) 0x........: main (peak.c:8)
+ 12          6,048            5,184            4,800           384            0
+ 13          7,776            6,912            6,400           512            0
+ 14          7,920            7,056            6,416           640            0
+ 15          7,920            7,056            6,416           640            0
+90.93% (6,416B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->90.70% (6,400B) 0x........: main (peak.c:8)
 | 
-->00.23% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.23% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 16          4,032            3,456            3,200           256            0
- 17          4,896            4,320            4,000           320            0
- 18          4,968            4,392            4,008           384            0
- 19          4,968            4,392            4,008           384            0
-91.26% (4,008B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.07% (4,000B) 0x........: main (peak.c:8)
+ 16          8,064            6,912            6,400           512            0
+ 17          9,792            8,640            8,000           640            0
+ 18          9,936            8,784            8,016           768            0
+ 19          9,936            8,784            8,016           768            0
+91.26% (8,016B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.07% (8,000B) 0x........: main (peak.c:8)
 | 
-->00.18% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.18% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 20          5,040            4,320            4,000           320            0
- 21          5,904            5,184            4,800           384            0
- 22          5,976            5,256            4,808           448            0
- 23          5,976            5,256            4,808           448            0
-91.48% (4,808B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.32% (4,800B) 0x........: main (peak.c:8)
+ 20         10,080            8,640            8,000           640            0
+ 21         11,808           10,368            9,600           768            0
+ 22         11,952           10,512            9,616           896            0
+ 23         11,952           10,512            9,616           896            0
+91.48% (9,616B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.32% (9,600B) 0x........: main (peak.c:8)
 | 
-->00.15% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.15% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 24          6,048            5,184            4,800           384            0
- 25          6,912            6,048            5,600           448            0
- 26          6,984            6,120            5,608           512            0
- 27          6,984            6,120            5,608           512            0
-91.63% (5,608B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.50% (5,600B) 0x........: main (peak.c:8)
+ 24         12,096           10,368            9,600           768            0
+ 25         13,824           12,096           11,200           896            0
+ 26         13,968           12,240           11,216         1,024            0
+ 27         13,968           12,240           11,216         1,024            0
+91.63% (11,216B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.50% (11,200B) 0x........: main (peak.c:8)
 | 
-->00.13% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.13% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 28          7,056            6,048            5,600           448            0
- 29          7,920            6,912            6,400           512            0
- 30          7,992            6,984            6,408           576            0
- 31          7,992            6,984            6,408           576            0
-91.75% (6,408B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.64% (6,400B) 0x........: main (peak.c:8)
+ 28         14,112           12,096           11,200           896            0
+ 29         15,840           13,824           12,800         1,024            0
+ 30         15,984           13,968           12,816         1,152            0
+ 31         15,984           13,968           12,816         1,152            0
+91.75% (12,816B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.64% (12,800B) 0x........: main (peak.c:8)
 | 
-->00.11% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.11% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 32          8,064            6,912            6,400           512            0
- 33          8,928            7,776            7,200           576            0
- 34          9,000            7,848            7,208           640            0
- 35          9,000            7,848            7,208           640            0
-91.85% (7,208B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.74% (7,200B) 0x........: main (peak.c:8)
+ 32         16,128           13,824           12,800         1,024            0
+ 33         17,856           15,552           14,400         1,152            0
+ 34         18,000           15,696           14,416         1,280            0
+ 35         18,000           15,696           14,416         1,280            0
+91.85% (14,416B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.74% (14,400B) 0x........: main (peak.c:8)
 | 
-->00.10% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.10% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 36          9,072            7,776            7,200           576            0
- 37          9,936            8,640            8,000           640            0
- 38         10,008            8,712            8,008           704            0
- 39         10,008            8,712            8,008           704            0
-91.92% (8,008B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.83% (8,000B) 0x........: main (peak.c:8)
+ 36         18,144           15,552           14,400         1,152            0
+ 37         19,872           17,280           16,000         1,280            0
+ 38         20,016           17,424           16,016         1,408            0
+ 39         20,016           17,424           16,016         1,408            0
+91.92% (16,016B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.83% (16,000B) 0x........: main (peak.c:8)
 | 
-->00.09% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.09% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 40         10,080            8,640            8,000           640            0
- 41         10,944            9,504            8,800           704            0
- 42         11,016            9,576            8,808           768            0
- 43         11,016            9,576            8,808           768            0
-91.98% (8,808B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.90% (8,800B) 0x........: main (peak.c:8)
+ 40         20,160           17,280           16,000         1,280            0
+ 41         21,888           19,008           17,600         1,408            0
+ 42         22,032           19,152           17,616         1,536            0
+ 43         22,032           19,152           17,616         1,536            0
+91.98% (17,616B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.90% (17,600B) 0x........: main (peak.c:8)
 | 
-->00.08% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.08% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 44         11,088            9,504            8,800           704            0
- 45         11,952           10,368            9,600           768            0
- 46         12,024           10,440            9,608           832            0
- 47         12,024           10,440            9,608           832            0
-92.03% (9,608B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->91.95% (9,600B) 0x........: main (peak.c:8)
+ 44         22,176           19,008           17,600         1,408            0
+ 45         23,904           20,736           19,200         1,536            0
+ 46         24,048           20,880           19,216         1,664            0
+ 47         24,048           20,880           19,216         1,664            0
+92.03% (19,216B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->91.95% (19,200B) 0x........: main (peak.c:8)
 | 
-->00.08% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.08% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 48         12,096           10,368            9,600           768            0
- 49         12,960           11,232           10,400           832            0
- 50         13,032           11,304           10,408           896            0
- 51         13,032           11,304           10,408           896            0
-92.07% (10,408B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.00% (10,400B) 0x........: main (peak.c:8)
+ 48         24,192           20,736           19,200         1,536            0
+ 49         25,920           22,464           20,800         1,664            0
+ 50         26,064           22,608           20,816         1,792            0
+ 51         26,064           22,608           20,816         1,792            0
+92.07% (20,816B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.00% (20,800B) 0x........: main (peak.c:8)
 | 
-->00.07% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.07% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 52         13,104           11,232           10,400           832            0
- 53         13,968           12,096           11,200           896            0
- 54         14,040           12,168           11,208           960            0
- 55         14,040           12,168           11,208           960            0
-92.11% (11,208B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.04% (11,200B) 0x........: main (peak.c:8)
+ 52         26,208           22,464           20,800         1,664            0
+ 53         27,936           24,192           22,400         1,792            0
+ 54         28,080           24,336           22,416         1,920            0
+ 55         28,080           24,336           22,416         1,920            0
+92.11% (22,416B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.04% (22,400B) 0x........: main (peak.c:8)
 | 
-->00.07% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.07% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 56         14,112           12,096           11,200           896            0
- 57         14,976           12,960           12,000           960            0
- 58         15,048           13,032           12,008         1,024            0
- 59         15,048           13,032           12,008         1,024            0
-92.14% (12,008B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.08% (12,000B) 0x........: main (peak.c:8)
+ 56         28,224           24,192           22,400         1,792            0
+ 57         29,952           25,920           24,000         1,920            0
+ 58         30,096           26,064           24,016         2,048            0
+ 59         30,096           26,064           24,016         2,048            0
+92.14% (24,016B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.08% (24,000B) 0x........: main (peak.c:8)
 | 
-->00.06% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.06% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 60         15,120           12,960           12,000           960            0
- 61         15,984           13,824           12,800         1,024            0
- 62         16,056           13,896           12,808         1,088            0
- 63         16,056           13,896           12,808         1,088            0
-92.17% (12,808B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.11% (12,800B) 0x........: main (peak.c:8)
+ 60         30,240           25,920           24,000         1,920            0
+ 61         31,968           27,648           25,600         2,048            0
+ 62         32,112           27,792           25,616         2,176            0
+ 63         32,112           27,792           25,616         2,176            0
+92.17% (25,616B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.11% (25,600B) 0x........: main (peak.c:8)
 | 
-->00.06% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.06% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 64         16,128           13,824           12,800         1,024            0
- 65         16,992           14,688           13,600         1,088            0
- 66         17,064           14,760           13,608         1,152            0
- 67         17,064           14,760           13,608         1,152            0
-92.20% (13,608B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.14% (13,600B) 0x........: main (peak.c:8)
+ 64         32,256           27,648           25,600         2,048            0
+ 65         33,984           29,376           27,200         2,176            0
+ 66         34,128           29,520           27,216         2,304            0
+ 67         34,128           29,520           27,216         2,304            0
+92.20% (27,216B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.14% (27,200B) 0x........: main (peak.c:8)
 | 
-->00.05% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.05% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 68         17,136           14,688           13,600         1,088            0
- 69         18,000           15,552           14,400         1,152            0
- 70         18,072           15,624           14,408         1,216            0
- 71         18,072           15,624           14,408         1,216            0
-92.22% (14,408B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.17% (14,400B) 0x........: main (peak.c:8)
+ 68         34,272           29,376           27,200         2,176            0
+ 69         36,000           31,104           28,800         2,304            0
+ 70         36,144           31,248           28,816         2,432            0
+ 71         36,144           31,248           28,816         2,432            0
+92.22% (28,816B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.17% (28,800B) 0x........: main (peak.c:8)
 | 
-->00.05% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.05% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 72         18,144           15,552           14,400         1,152            0
- 73         19,008           16,416           15,200         1,216            0
- 74         19,080           16,488           15,208         1,280            0
- 75         19,080           16,488           15,208         1,280            0
-92.24% (15,208B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.19% (15,200B) 0x........: main (peak.c:8)
+ 72         36,288           31,104           28,800         2,304            0
+ 73         38,016           32,832           30,400         2,432            0
+ 74         38,160           32,976           30,416         2,560            0
+ 75         38,160           32,976           30,416         2,560            0
+92.24% (30,416B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.19% (30,400B) 0x........: main (peak.c:8)
 | 
-->00.05% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.05% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 76         19,152           16,416           15,200         1,216            0
- 77         20,016           17,280           16,000         1,280            0
- 78         20,088           17,352           16,008         1,344            0
- 79         20,088           17,352           16,008         1,344            0
-92.25% (16,008B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->92.21% (16,000B) 0x........: main (peak.c:8)
+ 76         38,304           32,832           30,400         2,432            0
+ 77         40,032           34,560           32,000         2,560            0
+ 78         40,176           34,704           32,016         2,688            0
+ 79         40,176           34,704           32,016         2,688            0
+92.25% (32,016B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->92.21% (32,000B) 0x........: main (peak.c:8)
 | 
-->00.05% (8B) in 1+ places, all below ms_print's threshold (01.00%)
+->00.05% (16B) in 1+ places, all below ms_print's threshold (01.00%)
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
- 80         20,160           17,280           16,000         1,280            0
+ 80         40,320           34,560           32,000         2,560            0