[malloc] Track maximum heap usage

Track the current and maximum heap usage, and display the maximum
during shutdown when DEBUG=malloc is enabled.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2017-03-22 20:01:25 +02:00
parent 65a3518013
commit c90b4d82b7
2 changed files with 23 additions and 3 deletions

View File

@@ -22,6 +22,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <valgrind/memcheck.h>
extern size_t freemem;
extern size_t usedmem;
extern size_t maxusedmem;
extern void * __malloc alloc_memblock ( size_t size, size_t align,
size_t offset );