Skip to content

Commit

Permalink
Simpler fix for unalloc mem in unordered_map
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav92003 committed Jan 24, 2025
1 parent 92a1bc1 commit a10721b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clients/drcachesim/tools/common/decode_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ template <class DecodeInfo> class decode_cache_t : public decode_cache_base_t {
void
clear_cache()
{
decode_cache_.clear();
// Just a clear() does not release all memory held by the unordered_map. So we
// need to fully replace it with a new one.
decode_cache_ = std::unordered_map<app_pc, DecodeInfo>();
}

private:
Expand Down

0 comments on commit a10721b

Please sign in to comment.