]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - util.c
the lexer now doesn't _allocate_ the token structure, also: the vector holding the...
[xonotic/gmqcc.git] / util.c
diff --git a/util.c b/util.c
index 5f66b2d8687173739ccfb32972c8fc332c8545c7..04560602859715cf41e7e8030380069fad08ea9d 100644 (file)
--- a/util.c
+++ b/util.c
@@ -87,6 +87,13 @@ void util_meminfo() {
     if (!opts_memchk)
         return;
 
+    for (info = mem_start; info; info = info->next) {
+        util_debug("MEM", "lost:       % 8u (bytes) at %s:%u\n",
+            info->byte,
+            info->file,
+            info->line);
+    }
+
     util_debug("MEM", "Memory information:\n\
         Total allocations:   %llu\n\
         Total deallocations: %llu\n\
@@ -98,13 +105,6 @@ void util_meminfo() {
            (mem_ab -  mem_db),
            (mem_at -  mem_dt)
     );
-
-    for (info = mem_start; info; info = info->next) {
-        util_debug("MEM", "%u bytes lost at %s:%u\n",
-            info->byte,
-            info->file,
-            info->line);
-    }
 }
 
 /*
@@ -198,6 +198,9 @@ void util_debug(const char *area, const char *ms, ...) {
     if (!opts_debug)
         return;
 
+    if (!strcmp(area, "MEM") && !opts_memchk)
+        return;
+
     va_start(va, ms);
     fprintf (stdout, "DEBUG: ");
     fputc   ('[',  stdout);