• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <stdlib.h>
2 
3 // Allocate some memory and then deallocate it, to get a nice up-then-down
4 // graph.
5 
main(void)6 int main(void)
7 {
8    // N=36 gives us 72 snapshots, which fills the text graph nicely.
9    #define N   36
10    int i;
11    int* a[N];
12 
13    for (i = 0; i < N; i++) {
14       a[i] = malloc(400);  // 400 is divisible by 16 -- so no slop.
15    }
16    for (i = 0; i < N-1; i++) {
17       free(a[i]);
18    }
19 
20    return 0;
21 }
22