diff options
-rw-r--r-- | src/common/ers.c | 11 | ||||
-rw-r--r-- | src/map/map.c | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/common/ers.c b/src/common/ers.c index b94b0888d..3b354166e 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -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) diff --git a/src/map/map.c b/src/map/map.c index a7b8513f7..1ba37fe75 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -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*() @@ -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"); |