manual-core.xml: Fix various xmllint issues.
[valgrind.git] / massif / tests / thresholds.c
blobfc665d514aafa0b0a23e25dcdef2121bc1af77f1
1 // This test is for testing that the --threshold options in both Massif and
2 // ms_print work as they should. A threshold of 10% is a good choice for
3 // this file, because in some parts of the tree it renders all children
4 // insignificant, and in others parts of the tree it renders only some
5 // children insignificant.
6 //
7 // Also, it's deliberate that the 'malloc(2000)' and 'my_malloc1(500)' calls
8 // are in 'main' -- at one point, ms_print was failing to connect some
9 // children arrows when a more significant child didn't have any children of
10 // its own, eg:
12 // |
13 // ->20.00% (2000B) 0x804846A: main (thresholds.c:43)
14 //
15 // ->13.00% (1300B) 0x80483A4: my_malloc2 (thresholds.c:16)
17 // (There must be a '|' between the '->'s.)
19 #include <stdlib.h>
21 void my_malloc1(int n)
23 malloc(n);
26 void my_malloc2(int n)
28 malloc(n);
31 void my_malloc3(int n)
33 malloc(n);
36 void a7550(void)
38 my_malloc1(48000);
39 my_malloc2( 7200);
42 void a450(void)
44 my_malloc2(2400);
45 my_malloc1( 800);
46 my_malloc2( 800);
47 my_malloc1( 400);
50 int main(void)
52 a7550();
53 a450();
54 my_malloc1(4000); // All sizes are divisible by 16 -- no slop.
55 malloc(16000);
56 my_malloc3(400);
57 return 0;