]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - util.c
AUTHORS
[xonotic/gmqcc.git] / util.c
diff --git a/util.c b/util.c
index b44d1c163eb33ba703129b27c3768e7dc242d854..010de9704da460444ab8030e9220dbe2ce0b4e91 100644 (file)
--- a/util.c
+++ b/util.c
@@ -68,19 +68,15 @@ void util_meminfo() {
         Total allocations:   %llu\n\
         Total deallocations: %llu\n\
         Total allocated:     %llu (bytes)\n\
-        Total deallocated:   %llu (bytes)\n",
+        Total deallocated:   %llu (bytes)\n\
+        Leaks found:         lost %llu (bytes) in %d allocations\n",
             mem_at, mem_dt,
-            mem_ab, mem_db
+            mem_ab, mem_db,
+            (mem_ab -  mem_db),
+            (mem_at -  mem_dt)
     );
 }
 
-//#ifndef mem_d
-//#define mem_d(x) util_memory_d((x), __LINE__, __FILE__)
-//#endif
-//#ifndef mem_a
-//#define mem_a(x) util_memory_a((x), __LINE__, __FILE__)
-//#endif
-
 /*
  * Some string utility functions, because strdup uses malloc, and we want
  * to track all memory (without replacing malloc).
@@ -248,7 +244,7 @@ int util_getline(char **lineptr, size_t *n, FILE *stream) {
     if (!lineptr || !n || !stream)
         return -1;
     if (!*lineptr) {
-        if (!(*lineptr = mem_a((*n = 64))))
+        if (!(*lineptr = mem_a((*n=64))))
             return -1;
     }