fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. extern void malloc_stats(void);
  5.  
  6. int main() {
  7. printf("Program start...\n");
  8. malloc_stats();
  9. printf("Allocating 1024 bytes...\n");
  10. void* p = malloc(1024);
  11. malloc_stats();
  12. printf("Allocating 1024 bytes...\n");
  13. void* p2 = malloc(1024);
  14. malloc_stats();
  15. printf("Freeing 1024 bytes...\n");
  16. free(p2);
  17. p2 = NULL;
  18. malloc_stats();
  19. printf("Freeing 1024 bytes...\n");
  20. free(p);
  21. p = NULL;
  22. malloc_stats();
  23. return 0;
  24. }
Success #stdin #stdout #stderr 0s 2160KB
stdin
Standard input is empty
stdout
Program start...
Allocating 1024 bytes...
Allocating 1024 bytes...
Freeing 1024 bytes...
Freeing 1024 bytes...
stderr
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     =          0
in use bytes     =          0
max mmap regions =          0
max mmap bytes   =          0
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     =          0
in use bytes     =          0
max mmap regions =          0
max mmap bytes   =          0
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     =          0
in use bytes     =          0
max mmap regions =          0
max mmap bytes   =          0
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     =          0
in use bytes     =          0
max mmap regions =          0
max mmap bytes   =          0
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     =          0
in use bytes     =          0
max mmap regions =          0
max mmap bytes   =          0