Author: Ghostwolf <foxxe@wtfs.net>
[ircu2.10.12-pk.git] / ircd / s_debug.c
index 96d986e6e87df66253c18f91abc3762f8ac4cd0f..c45a5325917a1fb9bf532641859b7cd91192599b 100644 (file)
@@ -20,6 +20,8 @@
  * $Id$
  *
  */
+#include "config.h"
+
 #include "s_debug.h"
 #include "channel.h"
 #include "class.h"
@@ -80,8 +82,8 @@ const char* debug_serveropts(void)
     AddC((char)('0' + (bp / 1000000) % 10));
   }
 
-#ifdef  CHROOTDIR
-  AddC('c');
+#ifndef NDEBUG
+  AddC('A');
 #endif
 #ifdef  DEBUGMODE
   AddC('D');
@@ -255,7 +257,7 @@ void count_memory(struct Client *cptr, char *nick)
       totcl = 0, totch = 0, totww = 0, tot = 0;
 
   count_whowas_memory(&wwu, &wwm, &wwa, &wwam);
-  wwm += sizeof(struct Whowas) * NICKNAMEHISTORYLENGTH;
+  wwm += sizeof(struct Whowas) * feature_int(FEAT_NICKNAMEHISTORYLENGTH);
   wwm += sizeof(struct Whowas *) * WW_MAX;
 
   for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr))
@@ -288,13 +290,6 @@ void count_memory(struct Client *cptr, char *nick)
   {
     ch++;
     chm += (strlen(chptr->chname) + sizeof(struct Channel));
-#if 0
-    /*
-     * XXX - Members already counted in clients, don't count twice
-     */
-    for (member = chptr->members; member; member = member->next_member)
-      chu++;
-#endif
     for (link = chptr->invites; link; link = link->next)
       chi++;
     for (link = chptr->banlist; link; link = link->next)
@@ -349,7 +344,7 @@ void count_memory(struct Client *cptr, char *nick)
             ":Whowas users %d(%zu) away %d(%zu)", wwu,
             wwu * sizeof(struct User), wwa, wwam);
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Whowas array %d(%zu)",
-            NICKNAMEHISTORYLENGTH, wwm);
+            feature_int(FEAT_NICKNAMEHISTORYLENGTH), wwm);
 
   totww = wwu * sizeof(struct User) + wwam + wwm;
 
@@ -386,7 +381,7 @@ void count_memory(struct Client *cptr, char *nick)
       dbufs_allocated + msg_allocated + msgbuf_allocated + rm;
   tot += sizeof(void *) * HASHSIZE * 3;
 
-#if !defined(NDEBUG)
+#if defined(MDEBUG)
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Allocations: %zu(%zu)",
             fda_get_block_count(), fda_get_byte_count());
 #endif