diff options
author | Hans Wennborg <hans@chromium.org> | 2011-09-12 10:21:10 +0100 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2011-09-12 10:21:10 +0100 |
commit | 213a68eb68ece93a8915ef18a8eba920d5a924a4 (patch) | |
tree | 392a4087dc91ee8f2fae8a06705a53c847afa046 /util/cache.cc | |
parent | 72630236513e7384cb0a2e8fffcae232135a5adc (diff) | |
download | leveldb-213a68eb68ece93a8915ef18a8eba920d5a924a4.tar.gz |
Sync with upstream @23860137.
Fix GCC -Wshadow warnings in LevelDB's public header files,
reported by Dustin.
Add in-memory Env implementation (helpers/memenv/*).
This enables users to create LevelDB databases in-memory.
Initialize ShardedLRUCache::last_id_ to zero.
This fixes a Valgrind warning.
(Also delete port/sha1_* which were removed upstream some time ago.)
Diffstat (limited to 'util/cache.cc')
-rw-r--r-- | util/cache.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/cache.cc b/util/cache.cc index ce99f08..7d1ebc1 100644 --- a/util/cache.cc +++ b/util/cache.cc @@ -285,7 +285,8 @@ class ShardedLRUCache : public Cache { } public: - explicit ShardedLRUCache(size_t capacity) { + explicit ShardedLRUCache(size_t capacity) + : last_id_(0) { const size_t per_shard = (capacity + (kNumShards - 1)) / kNumShards; for (int s = 0; s < kNumShards; s++) { shard_[s].SetCapacity(per_shard); |