Skip to content

Commit

Permalink
Re-implementing ERS report()
Browse files Browse the repository at this point in the history
available through map-server console input, type ers_report to print data (useful for debug purposes)

Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed Mar 29, 2013
1 parent be07517 commit 646f978
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/common/ers.c
Expand Up @@ -278,7 +278,16 @@ ERS ers_new(uint32 size, char *name, enum ERSOptions options)

void ers_report(void)
{
// FIXME: Someone use this? Is it really needed?
ers_cache_t *cache;
int i = 0;
for (cache = CacheList; cache; cache = cache->Next) {
ShowMessage(CL_BOLD"[Entry manager #%u report]\n"CL_NORMAL, ++i);
ShowMessage("\tinstances : %u\n", cache->ReferenceCount);
ShowMessage("\tblock array size : %u\n", cache->ObjectSize);
ShowMessage("\tallocated blocks : %u\n", cache->Free+cache->Used);
ShowMessage("\tentries being used : %u\n", cache->Used);
ShowMessage("\tunused entries : %u\n", cache->Free);
}
}

void ers_force_destroy_all(void)
Expand Down
3 changes: 3 additions & 0 deletions src/map/map.c
Expand Up @@ -5,6 +5,7 @@
#include "../common/cbasetypes.h"
#include "../common/core.h"
#include "../common/timer.h"
#include "../common/ers.h"
#include "../common/grfio.h"
#include "../common/malloc.h"
#include "../common/socket.h" // WFIFO*()
Expand Down Expand Up @@ -3255,6 +3256,8 @@ int parse_console(const char* buf)
runflag = 0;
}
}
else if( strcmpi("ers_report", type) == 0 )
ers_report();
else if( strcmpi("help", type) == 0 )
{
ShowInfo("To use GM commands:\n");
Expand Down

0 comments on commit 646f978

Please sign in to comment.