- int inuse = 0, mem = 0, tmp = 0;
-
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Clients: inuse: %d(%d)",
- clients.inuse, tmp = clients.inuse * sizeof(struct Client));
- mem += tmp;
- inuse += clients.inuse;
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, "Connections: inuse: %d(%d)",
- connections.inuse,
- tmp = connections.inuse * sizeof(struct Connection));
- mem += tmp;
- inuse += connections.inuse;
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Users: inuse: %d(%d)",
- users.inuse, tmp = users.inuse * sizeof(struct User));
- mem += tmp;
- inuse += users.inuse;
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Servs: inuse: %d(%d)",
- servs.inuse, tmp = servs.inuse * sizeof(struct Server));
- mem += tmp;
- inuse += servs.inuse;
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Links: inuse: %d(%d)",
- links.inuse, tmp = links.inuse * sizeof(struct SLink));
- mem += tmp;
- inuse += links.inuse;
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Confs: inuse: %d(%d)",
- GlobalConfCount, tmp = GlobalConfCount * sizeof(struct ConfItem));
- mem += tmp;
- inuse += GlobalConfCount;
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Totals: inuse %d %d",
- inuse, mem);
+ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s: inuse %zu(%zu) alloc %zu",
+ itemname, lstats->inuse, lstats->mem, lstats->alloc);
+ if (totals)
+ {
+ totals->inuse += lstats->inuse;
+ totals->alloc += lstats->alloc;
+ totals->mem += lstats->mem;
+ }