Rename redisMemOverhead to serverMemOverhead (#159)

Part of #144.

Signed-off-by: 0del <bany.y0599@gmail.com>
This commit is contained in:
0del 2024-04-03 09:29:42 +07:00 committed by GitHub
parent 7a7288b292
commit 98892bb5c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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

View File

@ -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, ...);