]> jfr.im git - irc/quakenet/newserv.git/blobdiff - core/nsmalloc.h
Forgot to commit changes to nsmalloc.
[irc/quakenet/newserv.git] / core / nsmalloc.h
index c7c4729b9e22efb06e06008e4331e9d21b6a2c2a..622d11f97fe2b6f64c54d0500171efe9230b039f 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>
 
@@ -20,10 +20,26 @@ void nsfreeall(unsigned int poolid);
 void nsexit(void);
 void *nsrealloc(unsigned int poolid, void *ptr, size_t size);
 void nscheckfreeall(unsigned int poolid);
-void initnsmalloc(void);
 
 #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 */