Skip to content

Commit 4070f87

Browse files
authored
Update LFUCache.cpp
1 parent 4b0f131 commit 4070f87

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/LFUCache.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,11 @@ void LFUCache::evict() {
7171
cache.erase(key_to_evict);
7272
}
7373
}
74+
75+
// Add this function to LFUCache.cpp
76+
void LFUCache::reset() {
77+
std::lock_guard<std::mutex> lock(cache_mutex);
78+
cache.clear();
79+
freq_map.clear();
80+
resetStats();
81+
}

0 commit comments

Comments
 (0)