]> jfr.im git - irc/quakenet/newserv.git/blobdiff - core/nsmalloc.h
merge
[irc/quakenet/newserv.git] / core / nsmalloc.h
index ea5d862cb0efb909b45e03271647b20c530ad7e1..35e5e2796775039a5a51a50b4868cce8dc36bbc7 100644 (file)
@@ -5,12 +5,12 @@
 
 #ifdef __NSMALLOC_C
 #define pool(x) #x
-#define beginpools() char *poolnames[MAXPOOL] =
+#define beginpools() char *nsmpoolnames[MAXPOOL] =
 #define endpools();
 #else
 #define pool(x) POOL_ ## x
 #define beginpools(x) typedef enum nsmallocpools
-#define endpools() nsmallocpools;
+#define endpools() nsmallocpools; extern char *nsmpoolnames[MAXPOOL];
 
 #include <stdlib.h>
 
@@ -19,11 +19,27 @@ void nsfree(unsigned int poolid, void *ptr);
 void nsfreeall(unsigned int poolid);
 void nsexit(void);
 void *nsrealloc(unsigned int poolid, void *ptr, size_t size);
-int nspoolstats(unsigned int poolid, size_t *size, unsigned long *count, char **poolname, size_t *realsize);
 void nscheckfreeall(unsigned int poolid);
 
 #define MAXPOOL                100
 
+struct nsminfo {
+  struct nsminfo *next;
+  struct nsminfo *prev;
+
+  size_t size;
+  char data[];
+};
+
+struct nsmpool {
+  struct nsminfo first;
+
+  unsigned long count;
+  size_t size;
+};
+
+extern struct nsmpool nsmpools[MAXPOOL];
+
 #endif
 
 /* Pools here in the order they were created */
@@ -41,6 +57,13 @@ beginpools() {
   pool(LUA),
   pool(TROJANSCAN),
   pool(NTERFACER),
+  pool(SQLITE),
+  pool(PQSQL),
+  pool(PATRICIA),
+  pool(PATRICIANICK),
+  pool(GLINE),
+  pool(TRUSTS),
+  pool(SPAMSCAN2),
 } endpools()
 
 #undef pool