mirror of
https://github.com/anope/anope.git
synced 2026-06-30 18:26:38 +02:00
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
This commit is contained in:
@@ -38,6 +38,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
|
||||
|
||||
Reference in New Issue
Block a user