diff --git a/src/object.c b/src/object.c index ee3564657..6e151f17b 100644 --- a/src/object.c +++ b/src/object.c @@ -1161,20 +1161,20 @@ size_t objectComputeSize(robj *key, robj *o, size_t sample_size, int dbid) { } /* Release data obtained with getMemoryOverheadData(). */ -void freeMemoryOverheadData(struct redisMemOverhead *mh) { +void freeMemoryOverheadData(struct serverMemOverhead *mh) { zfree(mh->db); zfree(mh); } -/* Return a struct redisMemOverhead filled with memory overhead +/* Return a struct serverMemOverhead filled with memory overhead * information used for the MEMORY OVERHEAD and INFO command. The returned * structure pointer should be freed calling freeMemoryOverheadData(). */ -struct redisMemOverhead *getMemoryOverheadData(void) { +struct serverMemOverhead *getMemoryOverheadData(void) { int j; size_t mem_total = 0; size_t mem = 0; size_t zmalloc_used = zmalloc_used_memory(); - struct redisMemOverhead *mh = zcalloc(sizeof(*mh)); + struct serverMemOverhead *mh = zcalloc(sizeof(*mh)); mh->total_allocated = zmalloc_used; mh->startup_allocated = server.initial_memory_usage; @@ -1309,7 +1309,7 @@ sds getMemoryDoctorReport(void) { int big_client_buf = 0; /* Client buffers are too big. */ int many_scripts = 0; /* Script cache has too many scripts. */ int num_reports = 0; - struct redisMemOverhead *mh = getMemoryOverheadData(); + struct serverMemOverhead *mh = getMemoryOverheadData(); if (mh->total_allocated < (1024*1024*5)) { empty = 1; @@ -1562,7 +1562,7 @@ NULL usage += dictEntryMemUsage(); addReplyLongLong(c,usage); } else if (!strcasecmp(c->argv[1]->ptr,"stats") && c->argc == 2) { - struct redisMemOverhead *mh = getMemoryOverheadData(); + struct serverMemOverhead *mh = getMemoryOverheadData(); addReplyMapLen(c,31+mh->num_dbs); diff --git a/src/server.c b/src/server.c index 1605938d0..37feaeac7 100644 --- a/src/server.c +++ b/src/server.c @@ -5660,7 +5660,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { const char *evict_policy = evictPolicyToString(); long long memory_lua = evalMemory(); long long memory_functions = functionsMemory(); - struct redisMemOverhead *mh = getMemoryOverheadData(); + struct serverMemOverhead *mh = getMemoryOverheadData(); /* Peak memory is updated from time to time by serverCron() so it * may happen that the instantaneous value is slightly bigger than diff --git a/src/server.h b/src/server.h index b9dbd65e7..809c6bd29 100644 --- a/src/server.h +++ b/src/server.h @@ -1396,7 +1396,7 @@ typedef struct redisOpArray { /* This structure is returned by the getMemoryOverheadData() function in * order to return memory overhead information. */ -struct redisMemOverhead { +struct serverMemOverhead { size_t peak_allocated; size_t total_allocated; size_t startup_allocated; @@ -3104,8 +3104,8 @@ void activeDefragCycle(void); unsigned int getLRUClock(void); unsigned int LRU_CLOCK(void); const char *evictPolicyToString(void); -struct redisMemOverhead *getMemoryOverheadData(void); -void freeMemoryOverheadData(struct redisMemOverhead *mh); +struct serverMemOverhead *getMemoryOverheadData(void); +void freeMemoryOverheadData(struct serverMemOverhead *mh); void checkChildrenDone(void); int setOOMScoreAdj(int process_class); void rejectCommandFormat(client *c, const char *fmt, ...);