- sMemBlockInfo * alias;
-
- alias = &memoryInfo;
- alias = alias->next;
- while (alias->ptr != ptr)
- alias = alias->next;
- free(ptr);
- currentAllocatedMemory -= alias->size;
- alias->prev->next = alias->next;
- if (alias->next != NULL)
- alias->next->prev = alias->prev;
- free(alias);
+ UINT32 total = 0;
+
+ fprintf(fp, "Memory usage:\n");
+
+// sMemBlockInfo * alias = &memoryInfo;
+// alias = alias->next;
+ sMemBlockInfo * alias= memoryInfo.next;
+
+ while (alias)
+ {
+ fprintf(fp, "\t%16i bytes: <%s> (@ %08X)\n", (int)alias->size, alias->info, (unsigned int)alias->ptr);
+ total += alias->size;
+ alias = alias->next;
+ }
+
+ fprintf(fp, "\n\t%16i bytes total(%i Mb)\n", (int)total, (int)(total >> 20));
+ fprintf(fp, "\n\t%16i bytes memory peak(%i Mb)\n", (int)maximumAllocatedMemory, (int)(maximumAllocatedMemory >> 20));