4 #include "../memcheck.h"
14 Then we leak D and C-F-G.
21 // Padding ensures the structu is the same size on 32-bit and 64-bit
23 char padding
[16 - 2*sizeof(struct _Node
*)];
28 Node
*x
= malloc(sizeof(Node
));
34 // This is a definite root.
39 // Building like this rather than "t = mk(mk(mk(NULL, NULL), ...)" seems to
40 // help avoid leaving pointers on the stack to supposedly-leaked blocks.
43 t
->r
= mk(); // C (48(16d,32i)/1 definitely leaked from here)
44 t
->l
->l
= mk(); // D (16/1 definitely leaked from here)
49 // Sever B->D, leaking D
52 // Sever A->C, leaking C-F-G
58 DECLARE_LEAK_COUNTERS
;
60 GET_INITIAL_LEAK_COUNTS
;
62 // See leak-cases.c for why we do the work in f().
65 CLEAR_CALLER_SAVED_REGS
;
66 GET_FINAL_LEAK_COUNTS
;
68 PRINT_LEAK_COUNTS(stderr
);