Skip to content

Commit

Permalink
Fix coverity uninitialized fields warnings in lru_cache
Browse files Browse the repository at this point in the history
Summary:
Coverity uninitialized member variable warnings in lru_cache
Closes facebook#3082

Differential Revision: D6173062

Pulled By: sagar0

fbshipit-source-id: 7bcfc653457bd362d46045d06527838c9a6adad6
  • Loading branch information
Prashant D authored and facebook-github-bot committed Oct 27, 2017
1 parent 50e95a6 commit d9240b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cache/lru_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d9240b5

Please sign in to comment.