Squashed commit of the following:
commit
a46e75f30321724c22d3cb9d47e362664c60c029
Author: ketjen <ketjen@cisco.com>
Date: Fri Jan 11 18:58:32 2019 -0800
hash: Added lru_cache_shared.h to HASH_INCLUDES
commit
5fbf496e9ecffd0e4b5d8d6e511b2c210f6b3e74
Author: ketjen <ketjen@cisco.com>
Date: Fri Jan 11 18:58:00 2019 -0800
hash: Moved list_iter assignment inside to avoid improper memory access
in LruCacheShared
hashes.h
ghash.h
xhash.h
- hashfcn.h
+ hashfcn.h
+ lru_cache_shared.h
)
add_library( hash OBJECT
${HASH_INCLUDES}
hashes.cc
- lru_cache_shared.h
lru_cache_shared.cc
ghash.cc
hashfcn.cc
std::lock_guard<std::mutex> cache_lock(cache_mutex);
// Remove the oldest entries if we have to reduce cache size.
- list_iter=list.end();
while (current_size > newsize)
{
+ list_iter = list.end();
--list_iter;
current_size--;
map.erase(list_iter->first);