+2000-12-01 net <simms@LUCIDA.QC.CA>
+
+ * ircd/motd.c: add a freelist for struct Motds
+
2000-11-30 Kevin L. Mitchell <klmitch@mit.edu>
* ircd/s_stats.c (report_feature_list): report features--only
struct Motd* local;
struct Motd* remote;
struct Motd* other;
+ struct Motd* freelist;
} MotdList;
/* Create a struct Motd and initialize it */
}
/* allocate memory and initialize the structure */
- tmp = (struct Motd *)MyMalloc(sizeof(struct Motd));
+ if (MotdList.freelist) {
+ tmp = MotdList.freelist;
+ MotdList.freelist = tmp->next;
+ } else
+ tmp = (struct Motd *)MyMalloc(sizeof(struct Motd));
tmp->next = 0;
tmp->type = type;
if (motd->cache) /* drop the cache */
motd_decache(motd);
- MyFree(motd); /* free the structure */
+ motd->next = MotdList.freelist;
+ MotdList.freelist = motd;
}
/* We use this routine to look up the struct Motd to send to any given