Fix coverity uninitialized fields warnings in lru_cache

Summary:
Coverity uninitialized member variable warnings in lru_cache
Closes https://github.com/facebook/rocksdb/pull/3082

Differential Revision: D6173062

Pulled By: sagar0

fbshipit-source-id: 7bcfc653457bd362d46045d06527838c9a6adad6
This commit is contained in:
Prashant D 2017-10-27 11:24:12 -07:00 committed by Facebook Github Bot
parent 50e95a63dd
commit d9240b548c

5
cache/lru_cache.cc vendored
View File

@ -100,7 +100,9 @@ void LRUHandleTable::Resize() {
}
LRUCacheShard::LRUCacheShard()
: high_pri_pool_usage_(0), high_pri_pool_ratio_(0), usage_(0), lru_usage_(0) {
: capacity_(0), high_pri_pool_usage_(0), strict_capacity_limit_(false),
high_pri_pool_ratio_(0), high_pri_pool_capacity_(0), usage_(0),
lru_usage_(0) {
// Make empty circular linked list
lru_.next = &lru_;
lru_.prev = &lru_;
@ -353,6 +355,7 @@ Status LRUCacheShard::Insert(const Slice& key, uint32_t hash, void* value,
e->deleter = deleter;
e->charge = charge;
e->key_length = key.size();
e->flags = 0;
e->hash = hash;
e->refs = (handle == nullptr
? 1