]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - stat.c
Major header reworking, this respects the namespaces properly. Makes object dependenc...
[xonotic/gmqcc.git] / stat.c
diff --git a/stat.c b/stat.c
index 3d4d4a44b71e6c0672ac194d76d31874f8488733..aecd7ebcd9619e81b3d3f5632e7a5a0eccb0eeb0 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1,3 +1,7 @@
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
 #include "gmqcc.h"
 
 /*
@@ -22,6 +26,12 @@ typedef struct {
     size_t value;
 } stat_size_entry_t, **stat_size_table_t;
 
+typedef struct {
+    uint64_t used;
+    uint64_t type;
+    uint64_t size;
+} stat_entry_t;
+
 static uint64_t          stat_mem_allocated         = 0;
 static uint64_t          stat_mem_deallocated       = 0;
 static uint64_t          stat_mem_allocated_total   = 0;
@@ -37,7 +47,6 @@ static stat_size_table_t stat_size_vectors          = NULL;
 static stat_size_table_t stat_size_hashtables       = NULL;
 static stat_mem_block_t *stat_mem_block_root        = NULL;
 
-
 /*
  * A tiny size_t key-value hashtbale for tracking vector and hashtable
  * sizes. We can use it for other things too, if we need to. This is
@@ -323,14 +332,14 @@ hash_table_t *util_htnew(size_t size) {
     if ((find = stat_size_get(stat_size_hashtables, size)))
         find->value++;
     else {
-        stat_used_hashtables++;
+        stat_type_hashtables++;
         stat_size_put(stat_size_hashtables, size, 1);
     }
 
     hashtable->size = size;
     memset(hashtable->table, 0, sizeof(hash_node_t*) * size);
 
-    stat_type_hashtables++;
+    stat_used_hashtables++;
     return hashtable;
 }