Skip to content

Commit

Permalink
Modify mem_freed variable in evict.c and Update debug.c (#376)
Browse files Browse the repository at this point in the history
Fix the mem_freed variable to be initialized with init.
with this PR prevents the variable from acting unknowingly.

Signed-off-by: NAM UK KIM <namuk2004@naver.com>
  • Loading branch information
Virusuki committed Apr 30, 2024
1 parent b283c6b commit e43fda5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/debug.c
Expand Up @@ -2625,7 +2625,7 @@ static size_t get_ready_to_signal_threads_tids(int sig_num, pid_t tids[TIDS_MAX_
if(tids_count == TIDS_MAX_SIZE) break;
}

/* Swap the last tid with the the current thread id */
/* Swap the last tid with the current thread id */
if(current_thread_index != -1) {
pid_t last_tid = tids[tids_count - 1];

Expand Down
4 changes: 1 addition & 3 deletions src/evict.c
Expand Up @@ -545,7 +545,7 @@ int performEvictions(void) {

int keys_freed = 0;
size_t mem_reported, mem_tofree;
long long mem_freed; /* May be negative */
long long mem_freed = 0; /* Maybe become negative */
mstime_t latency, eviction_latency;
long long delta;
int slaves = listLength(server.slaves);
Expand All @@ -563,8 +563,6 @@ int performEvictions(void) {

unsigned long eviction_time_limit_us = evictionTimeLimitUs();

mem_freed = 0;

latencyStartMonitor(latency);

monotime evictionTimer;
Expand Down

0 comments on commit e43fda5

Please sign in to comment.