12 #include "../clib/logfacility.h" 13 #include <format/format.h> 31 hinfo._pentry =
nullptr;
32 size_t blocks_used = 0, bytes_used = 0, blocks_free = 0, bytes_free = 0;
33 while ( ( heapstatus = _heapwalk( &hinfo ) ) == _HEAPOK )
35 if ( hinfo._useflag == _USEDENTRY )
38 bytes_used += hinfo._size;
43 bytes_free += hinfo._size;
47 _tmp.Format(
"Heap: Used {} blocks, {} bytes, Free {} blocks, {} bytes\n" )
48 << blocks_used << bytes_used << blocks_free << bytes_free;
49 _tmp.Format(
"Delta: Used {} blocks, {} bytes, Free {} blocks, {} bytes\n" )
52 last_blocks_used = blocks_used;
53 last_bytes_used = bytes_used;
54 last_blocks_free = blocks_free;
55 last_bytes_free = bytes_free;
60 _tmp <<
"OK - empty heap\n";
63 _tmp <<
"OK - end of heap\n";
66 _tmp <<
"ERROR - bad pointer to heap\n";
69 _tmp <<
"ERROR - bad start of heap\n";
72 _tmp <<
"ERROR - bad node in heap\n";
void PrintAllocationData()