Nicholas Nethercote 4ddcff03b9 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
2009-02-18 05:14:44 +00:00

22 lines
411 B
C

#include <stdlib.h>
// Allocate some memory and then deallocate it, to get a nice up-then-down
// graph.
int main(void)
{
// N=36 gives us 72 snapshots, which fills the text graph nicely.
#define N 36
int i;
int* a[N];
for (i = 0; i < N; i++) {
a[i] = malloc(400); // 400 is divisible by 16 -- so no slop.
}
for (i = 0; i < N-1; i++) {
free(a[i]);
}
return 0;
}