From d9240b548cbca225ff9c4b0a671e296f5e2c8860 Mon Sep 17 00:00:00 2001 From: Prashant D Date: Fri, 27 Oct 2017 11:24:12 -0700 Subject: [PATCH] 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 --- cache/lru_cache.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cache/lru_cache.cc b/cache/lru_cache.cc index 5d21b6cdc..e4ab4065e 100644 --- a/cache/lru_cache.cc +++ b/cache/lru_cache.cc @@ -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