diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-03 00:01:19 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-03 00:01:19 +0000 |
commit | eda1fca43e1712e7fc0bc2deb5adaa4b898eafe3 (patch) | |
tree | 283ba75381023ff014ad0fa4ffd3cb01bcb522ff /src/hostserv.c | |
parent | a765a1155ff362c46f38faab9d66a918490d2350 (diff) |
Merge commit 'trunk' into anopeng (1.8 updates, etc)
Conflicts:
src/main.c
src/mysql.c
version.log
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1504 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/hostserv.c')
-rw-r--r-- | src/hostserv.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/hostserv.c b/src/hostserv.c index 52dfbc0d9..dd98d279f 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -39,6 +39,36 @@ void moduleAddHostServCmds(void) /*************************************************************************/ /** + * Return information on memory use. + * Assumes pointers are valid. + **/ + +void get_hostserv_stats(long *nrec, long *memuse) +{ + long count = 0, mem = 0; + int i; + HostCore *hc; + + for (hc = head; hc; hc = hc->next) { + count++; + mem += sizeof(*hc); + if (hc->nick) + mem += strlen(hc->nick) + 1; + if (hc->vIdent) + mem += strlen(hc->vIdent) + 1; + if (hc->vHost) + mem += strlen(hc->vHost) + 1; + if (hc->creator) + mem += strlen(hc->creator) + 1; + } + + *nrec = count; + *memuse = mem; +} + +/*************************************************************************/ + +/** * HostServ initialization. * @return void */ |