Просмотр исходного кода

* Removed all the expmem code...still need to fix up memory table...
Removed it because it was utterly pointless and erroneous...
It wasn't revealing anything that valgrind could much more efficiently...


svn: 588

Bryan Drewery 22 лет назад
Родитель
Сommit
7c166d3016

+ 0 - 11
src/auth.c

@@ -36,17 +36,6 @@ int 				max_auth = 100;
 struct auth_t 			*auth = 0;
 #endif /* S_AUTH */
 
-/* Expected memory usage
- */
-int expmem_auth()
-{
-  int tot = 0;
-#ifdef S_AUTH
-  tot += sizeof(struct auth_t) * max_auth;
-#endif /* S_AUTH */
-  return tot;
-}
-
 #ifdef S_AUTH
 void init_auth_max()
 {

+ 0 - 32
src/botnet.c

@@ -32,24 +32,6 @@ char			botnetnick[HANDLEN + 1] = "";	/* Botnet nickname */
 int			share_unlinks = 1;		/* Allow remote unlinks of my
 							   sharebots? */
 
-
-int expmem_botnet()
-{
-  int size = 0, i;
-  tand_t *bot;
-
-  for (bot = tandbot; bot; bot = bot->next)
-    size += sizeof(tand_t);
-  size += (maxparty * sizeof(party_t));
-  for (i = 0; i < parties; i++) {
-    if (party[i].away)
-      size += strlen(party[i].away) + 1;
-    if (party[i].from)
-      size += strlen(party[i].from) + 1;
-  }
-  return size;
-}
-
 void init_bots()
 {
   tandbot = NULL;
@@ -1550,16 +1532,6 @@ static void display_pre_relay(int i, char *other)
   strcpy(other, "other  >rly");
 }
 
-static int expmem_relay(void *x)
-{
-  register struct relay_info *p = (struct relay_info *) x;
-  int tot = sizeof(struct relay_info);
-
-  if (p->chat)
-    tot += DCC_CHAT.expmem(p->chat);
-  return tot;
-}
-
 static void kill_relay(int idx, void *x)
 {
   register struct relay_info *p = (struct relay_info *) x;
@@ -1578,7 +1550,6 @@ struct dcc_table DCC_RELAY =
   NULL,
   NULL,
   display_relay,
-  expmem_relay,
   kill_relay,
   NULL
 };
@@ -1602,7 +1573,6 @@ struct dcc_table DCC_RELAYING =
   NULL,
   NULL,
   display_relaying,
-  expmem_relay,
   kill_relay,
   out_relay
 };
@@ -1616,7 +1586,6 @@ struct dcc_table DCC_FORK_RELAY =
   &connect_timeout,
   failed_tandem_relay,
   display_tandem_relay,
-  expmem_relay,
   kill_relay,
   NULL
 };
@@ -1630,7 +1599,6 @@ struct dcc_table DCC_PRE_RELAY =
   NULL,
   NULL,
   display_pre_relay,
-  expmem_relay,
   kill_relay,
   NULL
 };

+ 0 - 9
src/chanprog.c

@@ -193,15 +193,6 @@ void set_chanlist(const char *host, struct userrec *rec)
 	m->user = rec;
 }
 
-/* Calculate the memory we should be using
- */
-int expmem_chanprog()
-{
-  register int		 tot = 0;
-
-  return tot;
-}
-
 /* 0 marks all channels
  * 1 removes marked channels
  * 2 unmarks all channels

+ 0 - 23
src/config.c

@@ -655,29 +655,6 @@ void set_cfg_str(char *target, char *entryname, char *data)
   }
 }
 
-/* Expected memory usage
- */
-int expmem_config()
-{
-  int tot = 0, i;
-#ifdef S_DCCPASS
-{
-  struct cmd_pass *cp = NULL;
-  for (cp = cmdpass; cp; cp = cp->next) {
-    tot += sizeof(struct cmd_pass) + strlen(cp->name) + 1;
-  }
-}
-#endif /* S_DCCPASS */
-  for (i = 0; i < cfg_count; i++) {
-    tot += sizeof(void *);
-    if (cfg[i]->gdata)
-      tot += strlen(cfg[i]->gdata) + 1;
-    if (cfg[i]->ldata)
-      tot += strlen(cfg[i]->ldata) + 1;
-  }
-  return tot;
-}
-
 void init_config()
 {
 #ifdef S_AUTH

+ 0 - 5
src/crypt.c

@@ -8,11 +8,6 @@
 
 #include "main.h"
 
-int expmem_crypt()
-{
-  return 0;
-}
-
 #define CRYPT_BLOCKSIZE AES_BLOCK_SIZE
 #define CRYPT_KEYBITS 256
 #define CRYPT_KEYSIZE (CRYPT_KEYBITS / 8)

+ 0 - 45
src/dcc.c

@@ -447,11 +447,6 @@ static void display_dcc_bot_new(int idx, char *buf)
   sprintf(buf, "bot*  waited %lus", now - dcc[idx].timeval);
 }
 
-static int expmem_dcc_bot_(void *x)
-{
-  return sizeof(struct bot_info);
-}
-
 static void free_dcc_bot_(int n, void *x)
 {
   if (dcc[n].type == &DCC_BOT) {
@@ -470,7 +465,6 @@ struct dcc_table DCC_BOT_NEW =
   &bot_timeout,
   timeout_dcc_bot_new,
   display_dcc_bot_new,
-  expmem_dcc_bot_,
   free_dcc_bot_,
   NULL
 };
@@ -566,7 +560,6 @@ struct dcc_table DCC_BOT =
   NULL,
   NULL,
   display_dcc_bot,
-  expmem_dcc_bot_,
   free_dcc_bot_,
   NULL
 };
@@ -580,7 +573,6 @@ struct dcc_table DCC_FORK_BOT =
   &connect_timeout,
   failed_link,
   display_dcc_fork_bot,
-  expmem_dcc_bot_,
   free_dcc_bot_,
   NULL
 };
@@ -752,28 +744,6 @@ static void display_dcc_chat_pass(int idx, char *buf)
   sprintf(buf, "pass  waited %lus", now - dcc[idx].timeval);
 }
 
-static int expmem_dcc_general(void *x)
-{
-  register struct chat_info *p = (struct chat_info *) x;
-  int tot = sizeof(struct chat_info);
-
-  if (p->away)
-    tot += strlen(p->away) + 1;
-  if (p->buffer) {
-    struct msgq *q = p->buffer;
-
-    while (q) {
-      tot += sizeof(struct list_type);
-
-      tot += q->len + 1;
-      q = q->next;
-    }
-  }
-  if (p->su_nick)
-    tot += strlen(p->su_nick) + 1;
-  return tot;
-}
-
 static void kill_dcc_general(int idx, void *x)
 {
   register struct chat_info *p = (struct chat_info *) x;
@@ -931,7 +901,6 @@ struct dcc_table DCC_CHAT_SECPASS =
   &auth_timeout,
   tout_dcc_chat_secpass,
   display_dcc_chat_secpass,
-  expmem_dcc_general,
   kill_dcc_general,
   out_dcc_general
 };
@@ -945,7 +914,6 @@ struct dcc_table DCC_CHAT_PASS =
   &password_timeout,
   tout_dcc_chat_pass,
   display_dcc_chat_pass,
-  expmem_dcc_general,
   kill_dcc_general,
   out_dcc_general
 };
@@ -1133,7 +1101,6 @@ struct dcc_table DCC_CHAT =
   NULL,
   NULL,
   display_dcc_chat,
-  expmem_dcc_general,
   kill_dcc_general,
   out_dcc_general
 };
@@ -1380,16 +1347,6 @@ static void display_dupwait(int idx, char *buf)
   sprintf(buf, "wait  duplicate?");
 }
 
-static int expmem_dupwait(void *x)
-{
-  register struct dupwait_info *p = (struct dupwait_info *) x;
-  int tot = sizeof(struct dupwait_info);
-
-  if (p && p->chat && DCC_CHAT.expmem)
-    tot += DCC_CHAT.expmem(p->chat);
-  return tot;
-}
-
 static void kill_dupwait(int idx, void *x)
 {
   register struct dupwait_info *p = (struct dupwait_info *) x;
@@ -1410,7 +1367,6 @@ struct dcc_table DCC_DUPWAIT =
   &dupwait_timeout,
   timeout_dupwait,
   display_dupwait,
-  expmem_dupwait,
   kill_dupwait,
   NULL
 };
@@ -1635,7 +1591,6 @@ struct dcc_table DCC_TELNET_ID =
   &password_timeout,
   timeout_dcc_telnet_id,
   display_dcc_telnet_id,
-  expmem_dcc_general,
   kill_dcc_general,
   out_dcc_general
 };

+ 0 - 19
src/dccutil.c

@@ -55,25 +55,6 @@ void init_dcc_max()
 
 }
 
-int expmem_dccutil()
-{
-  int tot, i;
-  struct portmap *pmap;
-
-  tot = sizeof(struct dcc_t) * max_dcc + sizeof(sock_list) * MAXSOCKS;
-
-
-  for (pmap = root; pmap; pmap = pmap->next)
-    tot += sizeof(struct portmap);
-
-  for (i = 0; i < dcc_total; i++) {
-    if (dcc[i].type && dcc[i].type->expmem)
-      tot += dcc[i].type->expmem(dcc[i].u.other);
-  }
-  return tot;
-}
-
-
 /* Replace \n with \r\n */
 char *add_cr(char *buf)
 {

+ 0 - 66
src/dns.c

@@ -47,21 +47,6 @@ static void display_dcc_dnswait(int idx, char *buf)
   sprintf(buf, "dns   waited %lus", now - dcc[idx].timeval);
 }
 
-static int expmem_dcc_dnswait(void *x)
-{
-  register struct dns_info *p = (struct dns_info *) x;
-  int size = 0;
-
-  if (p) {
-    size = sizeof(struct dns_info);
-    if (p->host)
-      size += strlen(p->host) + 1;
-    if (p->cbuf)
-      size += strlen(p->cbuf) + 1;
-  }
-  return size;
-}
-
 static void kill_dcc_dnswait(int idx, void *x)
 {
   register struct dns_info *p = (struct dns_info *) x;
@@ -84,7 +69,6 @@ struct dcc_table DCC_DNSWAIT =
   0,
   0,
   display_dcc_dnswait,
-  expmem_dcc_dnswait,
   kill_dcc_dnswait,
   0
 };
@@ -137,20 +121,13 @@ static void dns_dccipbyhost(IP ip, char *hostn, int ok, void *other)
   }
 }
 
-static int dns_dccexpmem(void *other)
-{
-  return 0;
-}
-
 devent_type DNS_DCCEVENT_HOSTBYIP = {
   "DCCEVENT_HOSTBYIP",
-  dns_dccexpmem,
   dns_dcchostbyip
 };
 
 devent_type DNS_DCCEVENT_IPBYHOST = {
   "DCCEVENT_IPBYHOST",
-  dns_dccexpmem,
   dns_dccipbyhost
 };
 
@@ -232,30 +209,13 @@ static void dns_tcl_iporhostres(IP ip, char *hostn, int ok, void *other)
   nfree(tclinfo);
 }
 
-static int dns_tclexpmem(void *other)
-{
-  devent_tclinfo_t *tclinfo = (devent_tclinfo_t *) other;
-  int l = 0;
-
-  if (tclinfo) {
-    l = sizeof(devent_tclinfo_t);
-    if (tclinfo->proc)
-      l += strlen(tclinfo->proc) + 1;
-    if (tclinfo->paras)
-      l += strlen(tclinfo->paras) + 1;
-  }
-  return l;
-}
-
 devent_type DNS_TCLEVENT_HOSTBYIP = {
   "TCLEVENT_HOSTBYIP",
-  dns_tclexpmem,
   dns_tcl_iporhostres
 };
 
 devent_type DNS_TCLEVENT_IPBYHOST = {
   "TCLEVENT_IPBYHOST",
-  dns_tclexpmem,
   dns_tcl_iporhostres
 };
 
@@ -264,21 +224,6 @@ devent_type DNS_TCLEVENT_IPBYHOST = {
  *    Event functions
  */
 
-inline static int dnsevent_expmem(void)
-{
-  devent_t *de;
-  int tot = 0;
-
-  for (de = dns_events; de; de = de->next) {
-    tot += sizeof(devent_t);
-    if ((de->lookup == RES_IPBYHOST) && de->res_data.hostname)
-      tot += strlen(de->res_data.hostname) + 1;
-    if (de->type && de->type->expmem)
-      tot += de->type->expmem(de->other);
-  }
-  return tot;
-}
-
 void call_hostbyip(IP ip, char *hostn, int ok)
 {
   devent_t *de = dns_events, *ode = NULL, *nde = NULL;
@@ -395,14 +340,3 @@ void block_dns_ipbyhost(char *host)
   call_ipbyhost(host, 0, 0);
 }
 
-
-/*
- *   Misc functions
- */
-
-int expmem_dns(void)
-{
-  return dnsevent_expmem();
-}
-
-

+ 0 - 1
src/dns.h

@@ -9,7 +9,6 @@
 
 typedef struct {
   char *name;
-  int  (*expmem)(void *);
   void (*event)(IP, char *, int, void *);
 } devent_type;
 

+ 0 - 1
src/eggdrop.h

@@ -307,7 +307,6 @@ struct dcc_table {
   int *timeout_val;
   void (*timeout) ();
   void (*display) (int, char *);
-  int (*expmem) (void *);
   void (*kill) (int, void *);
   void (*output) (int, char *, void *);
   void (*outdone) (int);

+ 0 - 6
src/flags.c

@@ -746,11 +746,6 @@ static int botfl_tcl_set(Tcl_Interp *irp, struct userrec *u,
   return TCL_OK;
 }
 
-static int botfl_expmem(struct user_entry *e)
-{
-  return 0;
-}
-
 static void botfl_display(int idx, struct user_entry *e, struct userrec *u)
 {
   struct flag_record fr = {FR_BOT, 0, 0, 0, 0, 0};
@@ -774,7 +769,6 @@ struct user_entry_type USERENTRY_BOTFL =
   botfl_set,
   botfl_tcl_get,
   botfl_tcl_set,
-  botfl_expmem,
   botfl_display,
   "BOTFL"
 };

+ 1 - 2
src/main.c

@@ -631,7 +631,7 @@ void restart_chons();
 void check_static(char *, char *(*)());
 
 #include "mod/static.h"
-int init_mem(), init_dcc_max(), init_userent(), init_misc(), init_auth(), init_config(), init_bots(),
+int init_mem(), init_dcc_max(), init_userent(), init_auth(), init_config(), init_bots(),
  init_net(), init_modules(), init_tcl(int, char **), init_botcmd(), init_settings();
 
 void binds_init();
@@ -981,7 +981,6 @@ int main(int argc, char **argv)
   core_binds_init();
   init_dcc_max();
   init_userent();
-  init_misc();
   init_bots();
   init_net();
   init_modules();

+ 16 - 39
src/mem.c

@@ -33,36 +33,13 @@ struct {
 } memtbl[MEMTBLSIZE];
 #endif
 
-/* Prototypes */
-int expmem_chanprog();
-int expmem_misc();
-int expmem_fileq();
-int expmem_users();
-int expmem_dccutil();
-int expmem_botnet();
-int expmem_tcl();
-int expmem_tclhash();
-int expmem_tclmisc();
-int expmem_net();
-int expmem_modules();
-int expmem_config();
-int expmem_auth();
-int expmem_tcldcc();
-int expmem_dns();
-int expmem_crypt();
-
-
 /* calculate memory we SHOULD be using
  */
 
 int expected_memory(void)
 {
-  int tot;
+  int tot = 0;
 
-  tot = expmem_chanprog() + expmem_users() + expmem_config() + expmem_misc() +
-    expmem_dccutil() + expmem_botnet() + expmem_tcl() + expmem_tclhash() +
-    expmem_net() + expmem_modules(0) + expmem_tcldcc() + expmem_auth() +
-    expmem_tclmisc();
   return tot;
 }
 
@@ -123,21 +100,21 @@ void debug_mem_to_dcc(int idx)
   module_entry *me;
   char *p;
 
-  exp[0] = expmem_auth();
-  exp[1] = expmem_chanprog();
-  exp[2] = expmem_misc();
-  exp[3] = expmem_users();
-  exp[4] = expmem_net();
-  exp[5] = expmem_dccutil();
-  exp[6] = expmem_botnet();
-  exp[7] = expmem_tcl();
-  exp[8] = expmem_tclhash();
-  exp[9] = expmem_tclmisc();
-  exp[10] = expmem_modules(1);
-  exp[11] = expmem_tcldcc();
-  exp[12] = expmem_dns();
-  exp[13] = expmem_config();
-  exp[14] = expmem_crypt();
+  exp[0] = 0;
+  exp[1] = 0;
+  exp[2] = 0;
+  exp[3] = 0;
+  exp[4] = 0;
+  exp[5] = 0;
+  exp[6] = 0;
+  exp[7] = 0;
+  exp[8] = 0;
+  exp[9] = 0;
+  exp[10] = 0;
+  exp[11] = 0;
+  exp[12] = 0;
+  exp[13] = 0;
+  exp[14] = 0;
   for (me = module_list; me; me = me->next)
     me->mem_work = 0;
   for (i = 0; i < MAX_MEM; i++)

+ 0 - 17
src/misc.c

@@ -59,23 +59,6 @@ int	 conmask = LOG_MODES | LOG_CMDS | LOG_MISC; /* Console mask */
 int	 debug_output = 1;	/* Disply output to server to LOG_SERVEROUT */
 int 	 server_lag = 0;	/* GUESS! */
 
-
-/* Expected memory usage
- */
-int expmem_misc()
-{
-  int tot = 0;
-
-  tot += strlen(binname) + 1;
-
-  return tot;
-}
-
-void init_misc()
-{
-}
-
-
 /*
  *    Misc functions
  */

+ 1 - 45
src/mod/channels.mod/channels.c

@@ -794,50 +794,6 @@ static void channels_report(int idx, int details)
   }
 }
 
-static int expmem_masklist(masklist *m)
-{
-  int result = 0;
-
-  for (; m; m = m->next) {
-    result += sizeof(masklist);
-    if (m->mask)
-        result += strlen(m->mask) + 1;
-    if (m->who)
-        result += strlen(m->who) + 1;
-  }
-  return result;
-}
-
-static int channels_expmem()
-{
-  int tot = 0, i;
-  struct chanset_t *chan;
-
-  for (chan = chanset; chan; chan = chan->next) {
-    tot += sizeof(struct chanset_t);
-
-    tot += strlen(chan->channel.key) + 1;
-    if (chan->channel.topic)
-      tot += strlen(chan->channel.topic) + 1;
-    tot += (sizeof(struct memstruct) * (chan->channel.members + 1));
-
-    tot += expmem_masklist(chan->channel.ban);
-    tot += expmem_masklist(chan->channel.exempt);
-    tot += expmem_masklist(chan->channel.invite);
-
-    for (i = 0; i < 6 && chan->cmode[i].op; i++)
-      tot += strlen(chan->cmode[i].op) + 1;
-    if (chan->key)
-      tot += strlen(chan->key) + 1;
-    if (chan->rmkey)
-      tot += strlen(chan->rmkey) + 1;
-  }
-  tot += expmem_udef(udef);
-  if (lastdeletedmask)
-    tot += strlen(lastdeletedmask) + 1;
-  return tot;
-}
-
 cmd_t channels_bot[] = {
   {"cjoin",    "", (Function) got_cjoin, NULL},
   {"cpart",    "", (Function) got_cpart, NULL},
@@ -868,7 +824,7 @@ static Function channels_table[] =
   /* 0 - 3 */
   (Function) channels_start,
   (Function) NULL,
-  (Function) channels_expmem,
+  (Function) 0,
   (Function) channels_report,
   /* 4 - 7 */
   (Function) u_setsticky_mask,

+ 0 - 2
src/mod/channels.mod/channels.h

@@ -84,8 +84,6 @@ static int tcl_channel_modify(Tcl_Interp * irp, struct chanset_t *chan,
 			      int items, char **item);
 static int tcl_channel_add(Tcl_Interp * irp, char *, char *);
 static char *convert_element(char *src, char *dst);
-static int expmem_udef(struct udef_struct *);
-static int expmem_udef_chans (struct udef_chans *);
 static void free_udef_chans(struct udef_chans *);
 static int getudef(struct udef_chans *, char *);
 static void initudef(int type, char *, int);

+ 0 - 23
src/mod/channels.mod/udefchan.c

@@ -4,29 +4,6 @@
  *
  */
 
-static int expmem_udef(struct udef_struct *ul)
-{
-  int i = 0;
-
-  for (; ul; ul = ul->next) {
-    i += sizeof(struct udef_struct);
-    i += strlen(ul->name) + 1;
-    i += expmem_udef_chans(ul->values);
-  }
-  return i;
-}
-
-static int expmem_udef_chans(struct udef_chans *ul)
-{
-  int i = 0;
-
-  for (; ul; ul = ul->next) {
-    i += sizeof(struct udef_chans);
-    i += strlen(ul->chan) + 1;
-  }
-  return i;
-}
-
 static int getudef(struct udef_chans *ul, char *name)
 {
   int val = 0;

+ 1 - 9
src/mod/compress.mod/compress.c

@@ -371,22 +371,14 @@ static tcl_ints my_tcl_ints[] = {
   {NULL,                	NULL}
 };
 
-static int compress_expmem(void)
-{
-  return 0;
-}
-
 static int compress_report(int idx, int details)
 {
   if (details) {
-    int size = compress_expmem();
 
     dprintf(idx, "    %u file%s compressed\n", compressed_files,
             (compressed_files != 1) ? "s" : "");
     dprintf(idx, "    %u file%s uncompressed\n", uncompressed_files,
             (uncompressed_files != 1) ? "s" : "");
-    dprintf(idx, "    Using %d byte%s of memory\n", size,
-            (size != 1) ? "s" : "");
   }
 
   return 0;
@@ -399,7 +391,7 @@ static Function compress_table[] =
   /* 0 - 3 */
   (Function) compress_start,
   (Function) NULL,
-  (Function) compress_expmem,
+  (Function) 0,
   (Function) compress_report,
   /* 4 - 7 */
   (Function) compress_to_file,

+ 0 - 8
src/mod/console.mod/console.c

@@ -234,13 +234,6 @@ static int console_tcl_set(Tcl_Interp *irp, struct userrec *u,
   return TCL_OK;
 }
 
-static int console_expmem(struct user_entry *e)
-{
-  struct console_info *i = e->u.extra;
-
-  return sizeof(struct console_info) + strlen(i->channel) + 1;
-}
-
 static void console_display(int idx, struct user_entry *e, struct userrec *u)
 {
   struct console_info *i = e->u.extra;
@@ -290,7 +283,6 @@ static struct user_entry_type USERENTRY_CONSOLE =
   console_set,
   console_tcl_get,
   console_tcl_set,
-  console_expmem,
   console_display,
   "CONSOLE"
 };

+ 1 - 20
src/mod/dns.mod/dns.c

@@ -105,28 +105,9 @@ static struct dcc_table DCC_DNS =
  *    DNS module related code
  */
 
-static int dns_cache_expmem(void)
-{
-  struct resolve *rp;
-  int size = 0;
-
-  for (rp = expireresolves; rp; rp = rp->next) {
-    size += sizeof(struct resolve);
-    if (rp->hostn)
-      size += strlen(rp->hostn) + 1;
-  }
-  return size;
-}
-
-static int dns_expmem(void)
-{
-  return dns_cache_expmem();
-}
-
 static int dns_report(int idx, int details)
 {
   if (details) {
-    dprintf(idx, "    (cache uses %d bytes of memory)\n", dns_cache_expmem());
     dprintf(idx, "    DNS resolver is active.\n");
   }
   return 0;
@@ -139,7 +120,7 @@ static Function dns_table[] =
   /* 0 - 3 */
   (Function) dns_start,
   (Function) NULL,
-  (Function) dns_expmem,
+  (Function) 0,
   (Function) dns_report,
   /* 4 - 7 */
 };

+ 1 - 6
src/mod/irc.mod/irc.c

@@ -1483,11 +1483,6 @@ static char *traced_rfccompliant(ClientData cdata, Tcl_Interp *irp,
   return NULL;
 }
 
-static int irc_expmem()
-{
-  return 0;
-}
-
 static cmd_t irc_bot[] = {
   {"dp", "", (Function) mdop_request, NULL},
   {"gi", "", (Function) getin_request, NULL},
@@ -1513,7 +1508,7 @@ static Function irc_table[] =
   /* 0 - 3 */
   (Function) irc_start,
   (Function) NULL,
-  (Function) irc_expmem,
+  (Function) 0,
   (Function) irc_report,
   /* 4 - 7 */
   (Function) 0,		

+ 1 - 7
src/mod/notes.mod/notes.c

@@ -37,7 +37,6 @@ static struct user_entry_type USERENTRY_FWD =
   NULL,
   NULL,
   NULL,
-  NULL,
   fwd_display,
   "FWD"
 };
@@ -940,11 +939,6 @@ static cmd_t notes_load[] =
   {NULL,	NULL,	NULL,				NULL}
 };
 
-static int notes_expmem()
-{
-  return 0;
-}
-
 static void notes_report(int idx, int details)
 {
   if (details) {
@@ -961,7 +955,7 @@ static Function notes_table[] =
 {
   (Function) notes_start,
   (Function) NULL,
-  (Function) notes_expmem,
+  (Function) 0,
   (Function) notes_report,
   (Function) cmd_note,
 };

+ 1 - 33
src/mod/server.mod/server.c

@@ -1514,38 +1514,6 @@ static void msgq_clear(struct msgq_head *qh)
   qh->tot = qh->warned = 0;
 }
 
-static int msgq_expmem(struct msgq_head *qh)
-{
-  register int		 tot = 0;
-  register struct msgq	*m;
-
-  for (m = qh->head; m; m = m->next) {
-    tot += m->len + 1;
-    tot += sizeof(struct msgq);
-  }
-  return tot;
-}
-
-static int server_expmem()
-{
-  int			 tot = 0;
-  struct server_list	*s = serverlist;
-
-  for (; s; s = s->next) {
-    if (s->name)
-      tot += strlen(s->name) + 1;
-    if (s->pass)
-      tot += strlen(s->pass) + 1;
-    if (s->realname)
-      tot += strlen(s->realname) + 1;
-    tot += sizeof(struct server_list);
-  }
-
-  tot += msgq_expmem(&mq) + msgq_expmem(&hq) + msgq_expmem(&modeq);
-
-  return tot;
-}
-
 static cmd_t my_ctcps[] =
 {
   {"DCC",	"",	ctcp_DCC_CHAT,		"server:DCC"},
@@ -1558,7 +1526,7 @@ static Function server_table[] =
 {
   (Function) server_start,
   (Function) NULL,
-  (Function) server_expmem,
+  (Function) 0,
   (Function) server_report,
   /* 4 - 7 */
   (Function) NULL,		/* char * (points to botname later on)	*/

+ 0 - 1
src/mod/server.mod/servmsg.c

@@ -963,7 +963,6 @@ static struct dcc_table SERVER_SOCKET =
   NULL,
   timeout_server,
   display_server,
-  NULL,
   kill_server,
   NULL
 };

+ 1 - 33
src/mod/share.mod/share.c

@@ -139,19 +139,6 @@ static void check_delay()
   }
 }
 
-static int delay_expmem()
-{
-  int size = 0;
-  struct delay_mode *d = NULL;
-
-  for (d = start_delay; d; d = d->next) {
-    if (d->mask)
-      size += strlen(d->mask) + 1;
-    size += sizeof(struct delay_mode);
-  }
-  return size;
-}
-
 /*
  *   Botnet commands
  */
@@ -2076,30 +2063,11 @@ static void cancel_user_xfer(int idx, void *x)
     def_dcc_bot_kill(idx, x);
 }
 
-static int share_expmem()
-{
-  int tot = 0;
-  struct share_msgq *q;
-  tandbuf *t;
-
-  for (t = tbuf; t && t->bot[0]; t = t->next) {
-    tot += sizeof(tandbuf);
-    for (q = t->q; q; q = q->next) {
-	tot += sizeof(struct share_msgq);
-	tot += strlen(q->msg) + 1;
-      }
-  }
-  tot += uff_expmem();
-  tot += delay_expmem();
-  return tot;
-}
-
 static void share_report(int idx, int details)
 {
   int i, j;
 
   if (details) {
-    dprintf(idx, "    Share module, using %d bytes.\n", share_expmem());
     dprintf(idx, "    Private owners: %3s   Allow resync: %3s\n",
 	    (private_global || (private_globals_bitmask() & USER_OWNER)) ?
 	    "yes" : "no", allow_resync ? "yes" : "no");
@@ -2155,7 +2123,7 @@ static Function share_table[] =
   /* 0 - 3 */
   (Function) share_start,
   (Function) NULL,
-  (Function) share_expmem,
+  (Function) 0,
   (Function) share_report,
   /* 4 - 7 */
   (Function) finish_share,

+ 0 - 12
src/mod/share.mod/uf_features.c

@@ -66,18 +66,6 @@ static void uff_init(void)
   egg_bzero(&uff_list, sizeof(uff_head_t));
 }
 
-/* Calculate memory used for list.
- */
-static int uff_expmem(void)
-{
-  uff_list_t *ul;
-  int tot = 0;
-
-  for (ul = uff_list.start; ul; ul = ul->next)
-    tot += sizeof(uff_list_t);
-  return tot;
-}
-
 /* Search for a feature in the uff feature list that matches a supplied
  * feature flag. Returns a pointer to the entry in the list or NULL if
  * no feature uses the flag.

+ 1 - 44
src/mod/transfer.mod/transfer.c

@@ -204,16 +204,6 @@ static void check_toutlost(struct userrec *u, char *nick, char *path,
  *    File queue functions
  */
 
-static int expmem_fileq()
-{
-  fileq_t *q;
-  int tot = 0;
-
-  for (q = fileq; q; q = q->next)
-    tot += strlen(q->dir) + strlen(q->file) + 2 + sizeof(fileq_t);
-  return tot;
-}
-
 static void queue_file(char *dir, char *file, char *from, char *to)
 {
   fileq_t *q = fileq;
@@ -1210,22 +1200,6 @@ static void display_dcc_fork_send(int idx, char *buf)
   sprintf(buf,TRANSFER_CONN_SEND);
 }
 
-static int expmem_dcc_xfer(void *x)
-{
-  register struct xfer_info *p = (struct xfer_info *) x;
-  int tot;
-
-  tot = sizeof(struct xfer_info);
-  if (p->filename)
-    tot += strlen(p->filename) + 1;
-  /* We need to check if origname points to filename before
-   * accounting for the memory.
-   */
-  if (p->origname && p->filename != p->origname)
-    tot += strlen(p->origname) + 1;
-  return tot;
-}
-
 static void kill_dcc_xfer(int idx, void *x)
 {
   register struct xfer_info *p = (struct xfer_info *) x;
@@ -1261,7 +1235,6 @@ static struct dcc_table DCC_SEND =
   &wait_dcc_xfer,
   tout_dcc_send,
   display_dcc_send,
-  expmem_dcc_xfer,
   kill_dcc_xfer,
   out_dcc_xfer
 };
@@ -1277,7 +1250,6 @@ static struct dcc_table DCC_FORK_SEND =
   &wait_dcc_xfer,
   eof_dcc_fork_send,
   display_dcc_fork_send,
-  expmem_dcc_xfer,
   kill_dcc_xfer,
   out_dcc_xfer
 };
@@ -1304,7 +1276,6 @@ static struct dcc_table DCC_GET =
   &wait_dcc_xfer,
   transfer_get_timeout,
   display_dcc_get,
-  expmem_dcc_xfer,
   kill_dcc_xfer,
   out_dcc_xfer,
   outdone_dcc_xfer
@@ -1319,7 +1290,6 @@ static struct dcc_table DCC_GET_PENDING =
   &wait_dcc_xfer,
   transfer_get_timeout,
   display_dcc_get_p,
-  expmem_dcc_xfer,
   kill_dcc_xfer,
   out_dcc_xfer
 };
@@ -1612,11 +1582,6 @@ static int fstat_kill(struct user_entry *e)
   return 1;
 }
 
-static int fstat_expmem(struct user_entry *e)
-{
-  return sizeof(struct filesys_stats);
-}
-
 static void fstat_display(int idx, struct user_entry *e, struct userrec *u)
 {
   struct filesys_stats *fs;
@@ -1649,7 +1614,6 @@ static struct user_entry_type USERENTRY_FSTAT =
   fstat_set,
   fstat_tcl_get,
   fstat_tcl_set,
-  fstat_expmem,
   fstat_display,
   "FSTAT"
 };
@@ -1848,18 +1812,11 @@ static cmd_t transfer_load[] =
  *   Module functions
  */
 
-
-static int transfer_expmem()
-{
-  return expmem_fileq();
-}
-
 static void transfer_report(int idx, int details)
 {
   if (details) {
     dprintf(idx,TRANSFER_STAT_BLOCK,
 	    dcc_block, (dcc_block == 0) ? " (turbo dcc)" : "", dcc_limit);
-    dprintf(idx,TRANSFER_STAT_MEMORY, transfer_expmem());
   }
 }
 
@@ -1869,7 +1826,7 @@ static Function transfer_table[] =
 {
   (Function) transfer_start,
   (Function) NULL,
-  (Function) transfer_expmem,
+  (Function) 0,
   (Function) transfer_report,
   /* 4- 7 */
   (Function) & DCC_FORK_SEND,		/* struct dcc_table		*/

+ 1 - 9
src/mod/update.mod/update.c

@@ -436,19 +436,11 @@ static void check_updates()
 }
 #endif /* HUB */
 
-static int update_expmem()
-{
-  int tot = 0;
-  return tot;
-}
-
 static void update_report(int idx, int details)
 {
   int i, j;
 
   if (details) {
-    dprintf(idx, "    update module, using %d bytes.\n", update_expmem());
-
     for (i = 0; i < dcc_total; i++)
       if (dcc[i].type == &DCC_BOT) {
 	if (dcc[i].status & STAT_GETTINGU) {
@@ -496,7 +488,7 @@ static Function update_table[] =
   /* 0 - 3 */
   (Function) update_start,
   (Function) NULL,
-  (Function) update_expmem,
+  (Function) 0,
   (Function) update_report,
   /* 4 - 7 */
   (Function) finish_update,

+ 0 - 30
src/modules.c

@@ -633,36 +633,6 @@ void init_modules(void)
     hook_list[i] = NULL;
 }
 
-int expmem_modules(int y)
-{
-  int c = 0;
-  int i;
-  module_entry *p;
-  dependancy *d;
-  struct hook_entry *q;
-  struct static_list *s;
-  Function *f;
-
-  for (s = static_modules; s; s = s->next)
-    c += sizeof(struct static_list) + strlen(s->name) + 1;
-
-  for (i = 0; i < REAL_HOOKS; i++)
-    for (q = hook_list[i]; q; q = q->next)
-      c += sizeof(struct hook_entry);
-
-  for (d = dependancy_list; d; d = d->next)
-    c += sizeof(dependancy);
-
-  for (p = module_list; p; p = p->next) {
-    c += sizeof(module_entry);
-    c += strlen(p->name) + 1;
-    f = p->funcs;
-    if (f && f[MODCALL_EXPMEM] && !y)
-      c += (int) (f[MODCALL_EXPMEM] ());
-  }
-  return c;
-}
-
 int module_register(char *name, Function * funcs,
 		    int major, int minor)
 {

+ 0 - 15
src/net.c

@@ -242,21 +242,6 @@ int ssl_cleanup() {
 #endif /* HAVE_SSL */
 
 
-int expmem_net()
-{
-  int i, tot = 0;
-
-  for (i = 0; i < MAXSOCKS; i++) {
-    if (!(socklist[i].flags & SOCK_UNUSED)) {
-      if (socklist[i].inbuf != NULL)
-	tot += strlen(socklist[i].inbuf) + 1;
-      if (socklist[i].outbuf != NULL)
-	tot += socklist[i].outbuflen;
-    }
-  }
-  return tot;
-}
-
 /* Get my ipv? ip
  */
 char *myipstr(int af_type)

+ 0 - 1
src/proto.h

@@ -357,7 +357,6 @@ int findanyidx(int);
 /* userent.c */
 void update_mod(char *, char *, char *, char *);
 void list_type_kill(struct list_type *);
-int list_type_expmem(struct list_type *);
 int xtra_set();
 void stats_add(struct userrec *, int, int);
 

+ 1 - 6
src/tcl.c

@@ -70,11 +70,6 @@ int	    clientdata_stuff = 0;
 /* Prototypes for tcl */
 Tcl_Interp *Tcl_CreateInterp();
 
-int expmem_tcl()
-{
-  return strtot + utftot + clientdata_stuff;
-}
-
 int findidx(int z)
 {
   int j;
@@ -106,7 +101,7 @@ static void botnet_change(char *new)
  *     Vars, traces, misc
  */
 
-int init_dcc_max(), init_misc();
+int init_dcc_max();
 
 /* Used for read/write to integer couplets */
 typedef struct {

+ 0 - 6
src/tcldcc.c

@@ -26,12 +26,6 @@ extern unsigned long otraffic_irc, otraffic_irc_today, itraffic_irc, itraffic_ir
 
 int			 enable_simul = 0;
 
-int expmem_tcldcc(void)
-{
-  int tot = 0;
-  return tot;
-}
-
 /***********************************************************************/
 
 static int tcl_putdcc STDVAR

+ 0 - 11
src/tclhash.c

@@ -14,7 +14,6 @@
 #include "users.h"
 #include "match.c"
 
-extern Tcl_Interp	*interp;
 extern struct dcc_t	*dcc;
 extern struct userrec	*userlist;
 extern int		 dcc_total;
@@ -42,8 +41,6 @@ static bind_table_t *BT_chpt;
 static bind_table_t *BT_chjn;
 
 
-p_tcl_bind_list		bind_table_list;
-
 static char *my_strdup(const char *s)
 {
 	char *t;
@@ -70,14 +67,6 @@ static inline void *n_malloc_null(int size, const char *file, int line)
   return ptr;
 }
 
-int expmem_tclhash(void)
-{
-  int			 tot = 0;
-
-  return tot;
-}
-
-
 extern cmd_t C_dcc[];
 
 void binds_init(void)

+ 0 - 2
src/tclhash.h

@@ -117,8 +117,6 @@ typedef struct tcl_bind_list_b {
 
 
 void kill_binds(void);
-int expmem_tclhash(void);
-
 
 
 void check_dcc(const char *, int, const char *);

+ 0 - 6
src/tclmisc.c

@@ -18,12 +18,6 @@ extern module_entry	*module_list;
 extern int timesync;
 extern Tcl_Interp *interp;
 
-int expmem_tclmisc()
-{
-  int tot = 0;
-  return tot;
-}
-
 static int tcl_putlog STDVAR
 {
   char logtext[501];

+ 0 - 74
src/userent.c

@@ -49,16 +49,6 @@ void list_type_kill(struct list_type *t)
   }
 }
 
-int list_type_expmem(struct list_type *t)
-{
-  int tot = 0;
-
-  for (; t; t = t->next)
-    tot += sizeof(struct list_type) + strlen(t->extra) + 1;
-
-  return tot;
-}
-
 int def_unpack(struct userrec *u, struct user_entry *e)
 {
   char *tmp;
@@ -161,11 +151,6 @@ int def_tcl_set(Tcl_Interp * irp, struct userrec *u,
   return TCL_OK;
 }
 
-int def_expmem(struct user_entry *e)
-{
-  return strlen(e->u.string) + 1;
-}
-
 void def_display(int idx, struct user_entry *e, struct userrec *u)
 {
   dprintf(idx, "  %s: %s\n", e->type->name, e->u.string);
@@ -197,7 +182,6 @@ struct user_entry_type USERENTRY_COMMENT =
   def_set,
   def_tcl_get,
   def_tcl_set,
-  def_expmem,
   comment_display,
   "COMMENT"
 };
@@ -215,7 +199,6 @@ struct user_entry_type USERENTRY_INFO =
   def_set,
   def_tcl_get,
   def_tcl_set,
-  def_expmem,
   def_display,
   "INFO"
 };
@@ -258,25 +241,10 @@ struct user_entry_type USERENTRY_ADDED = {
   def_set,
   0,
   0,
-  def_expmem,
   added_display,
   "ADDED"
 };
 
-int config_expmem(struct user_entry *e)
-{
-  struct xtra_key *x;
-  int tot = 0;
-
-  for (x = e->u.extra; x; x = x->next) {
-    tot += sizeof(struct xtra_key);
-
-    tot += strlen(x->key) + 1;
-    tot += strlen(x->data) + 1;
-  }
-  return tot;
-}
-
 int config_set(struct userrec *u, struct user_entry *e, void *buf)
 {
   struct xtra_key *curr, *old = NULL, *new = buf;
@@ -486,7 +454,6 @@ struct user_entry_type USERENTRY_CONFIG = {
   config_set,
   0,
   0,
-  config_expmem,
   config_display,
   "CONFIG"
 };
@@ -544,7 +511,6 @@ struct user_entry_type USERENTRY_STATS = {
   def_set,
   0,
   0,
-  def_expmem,
   stats_display,
   "STATS"
 };
@@ -593,7 +559,6 @@ struct user_entry_type USERENTRY_MODIFIED =
   def_set,
   0,
   0,
-  def_expmem,
   modified_display,
   "MODIFIED"
 };
@@ -650,7 +615,6 @@ struct user_entry_type USERENTRY_PASS =
   pass_set,
   def_tcl_get,
   pass_tcl_set,
-  def_expmem,
   0,
   "PASS"
 };
@@ -688,7 +652,6 @@ struct user_entry_type USERENTRY_SECPASS =
   def_set,
   0,
   0,
-  def_expmem,
   secpass_display,
   "SECPASS"
 };
@@ -819,12 +782,6 @@ static int laston_tcl_set(Tcl_Interp * irp, struct userrec *u,
   return TCL_OK;
 }
 
-static int laston_expmem(struct user_entry *e)
-{
-  return sizeof(struct laston_info) +
-    strlen(((struct laston_info *) (e->u.extra))->lastonplace) + 1;
-}
-
 static int laston_dupuser(struct userrec *new, struct userrec *old,
 			  struct user_entry *e)
 {
@@ -854,7 +811,6 @@ struct user_entry_type USERENTRY_LASTON =
   laston_set,
   laston_tcl_get,
   laston_tcl_set,
-  laston_expmem,
   0,
   "LASTON"
 };
@@ -1026,14 +982,6 @@ static int botaddr_tcl_set(Tcl_Interp *irp, struct userrec *u,
   return TCL_OK;
 }
 
-static int botaddr_expmem(struct user_entry *e)
-{
-  register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
-
-  Context;
-  return strlen(bi->address) + 1 + strlen(bi->uplink) + 1 + sizeof(struct bot_addr);
-}
-
 static void botaddr_display(int idx, struct user_entry *e, struct userrec *u)
 {
 #ifdef HUB
@@ -1114,7 +1062,6 @@ struct user_entry_type USERENTRY_BOTADDR =
   botaddr_set,
   botaddr_tcl_get,
   botaddr_tcl_set,
-  botaddr_expmem,
   botaddr_display,
   "BOTADDR"
 };
@@ -1358,20 +1305,6 @@ static int xtra_tcl_get(Tcl_Interp *irp, struct userrec *u,
   return TCL_OK;
 }
 
-static int xtra_expmem(struct user_entry *e)
-{
-  struct xtra_key *x;
-  int tot = 0;
-
-  for (x = e->u.extra; x; x = x->next) {
-    tot += sizeof(struct xtra_key);
-
-    tot += strlen(x->key) + 1;
-    tot += strlen(x->data) + 1;
-  }
-  return tot;
-}
-
 struct user_entry_type USERENTRY_XTRA =
 {
   0,
@@ -1385,7 +1318,6 @@ struct user_entry_type USERENTRY_XTRA =
   xtra_set,
   xtra_tcl_get,
   xtra_tcl_set,
-  xtra_expmem,
   xtra_display,
   "XTRA"
 };
@@ -1423,11 +1355,6 @@ static int hosts_kill(struct user_entry *e)
   return 1;
 }
 
-static int hosts_expmem(struct user_entry *e)
-{
-  return list_type_expmem(e->u.list);
-}
-
 static void hosts_display(int idx, struct user_entry *e, struct userrec *u)
 {
 #ifdef LEAF
@@ -1549,7 +1476,6 @@ struct user_entry_type USERENTRY_HOSTS =
   hosts_set,
   hosts_tcl_get,
   hosts_tcl_set,
-  hosts_expmem,
   hosts_display,
   "HOSTS"
 };

+ 0 - 79
src/userrec.c

@@ -66,85 +66,6 @@ void *_user_realloc(void *ptr, int size, const char *file, int line)
 #endif /* DEBUG_MEM */
 }
 
-inline int expmem_mask(struct maskrec *m)
-{
-  int result = 0;
-
-  while (m) {
-    result += sizeof(struct maskrec);
-
-    result += strlen(m->mask) + 1;
-    if (m->user)
-      result += strlen(m->user) + 1;
-    if (m->desc)
-      result += strlen(m->desc) + 1;
-
-    m = m->next;
-  }
-
-  return result;
-}
-
-/* Memory we should be using
- */
-int expmem_users()
-{
-  int tot;
-  struct userrec *u;
-  struct chanuserrec *ch;
-  struct chanset_t *chan;
-  struct user_entry *ue;
-  struct igrec *i;
-
-  tot = 0;
-  for (u = userlist; u; u = u->next) {
-    for (ch = u->chanrec; ch; ch = ch->next) {
-      tot += sizeof(struct chanuserrec);
-
-      if (ch->info != NULL)
-        tot += strlen(ch->info) + 1;
-    }
-    tot += sizeof(struct userrec);
-
-    for (ue = u->entries; ue; ue = ue->next) {
-      tot += sizeof(struct user_entry);
-
-      if (ue->name) {
-        tot += strlen(ue->name) + 1;
-        tot += list_type_expmem(ue->u.list);
-      } else
-        tot += ue->type->expmem(ue);
-    }
-  }
-  /* Account for each channel's masks */
-  for (chan = chanset; chan; chan = chan->next) {
-
-    /* Account for each channel's ban-list user */
-    tot += expmem_mask(chan->bans);
-
-    /* Account for each channel's exempt-list user */
-    tot += expmem_mask(chan->exempts);
-
-    /* Account for each channel's invite-list user */
-    tot += expmem_mask(chan->invites);
-  }
-
-  tot += expmem_mask(global_bans);
-  tot += expmem_mask(global_exempts);
-  tot += expmem_mask(global_invites);
-
-  for (i = global_ign; i; i = i->next) {
-    tot += sizeof(struct igrec);
-
-    tot += strlen(i->igmask) + 1;
-    if (i->user)
-      tot += strlen(i->user) + 1;
-    if (i->msg)
-      tot += strlen(i->msg) + 1;
-  }
-  return tot;
-}
-
 int count_users(struct userrec *bu)
 {
   int tot = 0;

+ 0 - 2
src/users.h

@@ -41,7 +41,6 @@ struct user_entry_type {
 		  int, char **);
   int (*tcl_set) (Tcl_Interp *, struct userrec *, struct user_entry *,
 		  int, char **);
-  int (*expmem) (struct user_entry *);
   void (*display) (int idx, struct user_entry *, struct userrec *);
   char *name;
 };
@@ -187,7 +186,6 @@ int def_tcl_get(Tcl_Interp *interp, struct userrec *u,
 		struct user_entry *e, int argc, char **argv);
 int def_tcl_set(Tcl_Interp *irp, struct userrec *u,
 		struct user_entry *e, int argc, char **argv);
-int def_expmem(struct user_entry *e);
 void def_display(int idx, struct user_entry *e, struct userrec *u);
 int def_dupuser(struct userrec *new, struct userrec *old,
 		struct user_entry *e);