Skip to content

Instantly share code, notes, and snippets.

@krpors
Created November 14, 2016 12:30
Show Gist options
  • Save krpors/8f13d33749a46448b6aef2d2e4a8b21e to your computer and use it in GitHub Desktop.
Save krpors/8f13d33749a46448b6aef2d2e4a8b21e to your computer and use it in GitHub Desktop.
Malloc decrease 'report' by using sort of geometric expansion
before:
==27562== Memcheck, a memory error detector
==27562== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==27562== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==27562== Command: ./hx hx
==27562==
==27562==
==27562== HEAP SUMMARY:
==27562== in use at exit: 0 bytes in 0 blocks
==27562== total heap usage: 956 allocs, 956 frees, 1,638,802 bytes allocated
==27562==
==27562== All heap blocks were freed -- no leaks are possible
==27562==
==27562== For counts of detected and suppressed errors, rerun with: -v
==27562== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
after:
==28540== Memcheck, a memory error detector
==28540== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==28540== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==28540== Command: ./hx hx
==28540==
==28540==
==28540== HEAP SUMMARY:
==28540== in use at exit: 0 bytes in 0 blocks
==28540== total heap usage: 13 allocs, 13 frees, 68,831 bytes allocated
==28540==
==28540== All heap blocks were freed -- no leaks are possible
==28540==
==28540== For counts of detected and suppressed errors, rerun with: -v
==28540== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment