Fix some memory counting buglets.
authorMichael Poole <mdpoole@troilus.org>
Tue, 14 Jun 2005 04:47:00 +0000 (04:47 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 14 Jun 2005 04:47:00 +0000 (04:47 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1422 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_conf.c
ircd/s_debug.c
ircd/s_user.c

index a5c03f0749084378097d26630205d80e719f7f7f..ef85125d20252952f9eca276acc0269d2062453e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-05-13  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/s_user.c (make_user): Unconditionally increment userCount.
+       (free_user): Unconditionally decrement it here.
+
+       * ircd/s_conf.c (make_conf): Unconditionally increment
+       GlobalConfCount.
+       (free_conf): Unconditionally decrement it here.
+
+       * ircd/s_debug.c (count_memory): Fix termination condition for
+       ban-walking loop.  Add missing "e" to "members".
+
+
 2005-05-10  Michael Poole <mdpoole@troilus.org>
 
        * ircd/match.c (check_if_ipmask): Strings that contain '?' cannot
index afcfa6c93b655e4a80a7e4fc6525b02fe5559e21..2dea3591ae4a50065369bf49335b326e4af0be1f 100644 (file)
@@ -129,9 +129,7 @@ struct ConfItem* make_conf(int type)
 
   aconf = (struct ConfItem*) MyMalloc(sizeof(struct ConfItem));
   assert(0 != aconf);
-#ifdef        DEBUGMODE
   ++GlobalConfCount;
-#endif
   memset(aconf, 0, sizeof(struct ConfItem));
   aconf->status  = type;
   aconf->next    = GlobalConfList;
@@ -159,9 +157,7 @@ void free_conf(struct ConfItem *aconf)
   MyFree(aconf->name);
   MyFree(aconf->hub_limit);
   MyFree(aconf);
-#ifdef        DEBUGMODE
   --GlobalConfCount;
-#endif
 }
 
 /** Disassociate configuration from the client.
index c1e6169e3d68d939a5238ec9f30b4f5bb5cd6fc9..6df059bbf00765a5db22b1a46e72ef104d5d9333 100644 (file)
@@ -292,7 +292,7 @@ void count_memory(struct Client *cptr, const struct StatDesc *sd,
     chm += (strlen(chptr->chname) + sizeof(struct Channel));
     for (link = chptr->invites; link; link = link->next)
       chi++;
-    for (ban = chptr->banlist; link; ban = ban->next)
+    for (ban = chptr->banlist; ban; ban = ban->next)
     {
       chb++;
       chbm += strlen(ban->who) + strlen(ban->banstr) + 2 + sizeof(*ban);
@@ -335,7 +335,7 @@ void count_memory(struct Client *cptr, const struct StatDesc *sd,
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
             ":Channels %d(%zu) Bans %d(%zu)", ch, chm, chb, chbm);
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
-            ":Channel membrs %d(%zu) invite %d(%zu)", memberships,
+            ":Channel members %d(%zu) invite %d(%zu)", memberships,
             memberships * sizeof(struct Membership), chi,
             chi * sizeof(struct SLink));
 
index 285acb64f8a2d154b0e44230faabc69f5853f64d..141c0f8a8854ed57cd33b9ec798f9f85c44e8a62 100644 (file)
@@ -91,9 +91,7 @@ struct User *make_user(struct Client *cptr)
 
     /* All variables are 0 by default */
     memset(cli_user(cptr), 0, sizeof(struct User));
-#ifdef  DEBUGMODE
     ++userCount;
-#endif
     cli_user(cptr)->refcnt = 1;
   }
   return cli_user(cptr);
@@ -120,9 +118,7 @@ void free_user(struct User* user)
     assert(0 == user->channel);
 
     MyFree(user);
-#ifdef  DEBUGMODE
     --userCount;
-#endif
   }
 }