4 #include "../memcheck.h"
11 int* reachable
__attribute__((unused
));
13 int* leaked
__attribute__((unused
));
14 DECLARE_LEAK_COUNTERS
;
16 /* we require these longs to have same size as a machine word */
17 assert(sizeof(long) == sizeof(void*));
20 fprintf(stderr
, "errors: %d\n\n", VALGRIND_COUNT_ERRORS
);
28 fprintf(stderr
, "errors: %d\n\n", VALGRIND_COUNT_ERRORS
);
30 // Get a baseline, after start-up and also after printf (because Darwin
31 // printf allocates memory the first time it's called!)
32 GET_INITIAL_LEAK_COUNTS
;
34 fprintf(stderr
, "errors: %d\n\n", VALGRIND_COUNT_ERRORS
);
37 GET_FINAL_LEAK_COUNTS
;
38 PRINT_LEAK_COUNTS(stderr
);
39 fprintf(stderr
, "\n");
41 fprintf(stderr
, "errors: %d\n\n", VALGRIND_COUNT_ERRORS
);
49 reachable
= malloc(99);
51 GET_FINAL_LEAK_COUNTS
;
52 PRINT_LEAK_COUNTS(stderr
);
53 fprintf(stderr
, "\n");
55 fprintf(stderr
, "errors: %d\n", VALGRIND_COUNT_ERRORS
);