summaryrefslogtreecommitdiff
path: root/util/cache.cc
diff options
context:
space:
mode:
authorChris Mumford <cmumford@google.com>2019-05-09 14:00:07 -0700
committerChris Mumford <cmumford@google.com>2019-05-09 14:11:06 -0700
commit28e6d238be73e743c963fc0a26395b783a7565e2 (patch)
tree08c01ab9c9a7ece5f2e88b90bb69e8a378988b5d /util/cache.cc
parent85cd40d108d8f8d91f58fd263c0f8428d11c34d5 (diff)
downloadleveldb-28e6d238be73e743c963fc0a26395b783a7565e2.tar.gz
Switch to using C++ 11 override specifier.
PiperOrigin-RevId: 247491163
Diffstat (limited to 'util/cache.cc')
-rw-r--r--util/cache.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/util/cache.cc b/util/cache.cc
index 0f801cc..12de306 100644
--- a/util/cache.cc
+++ b/util/cache.cc
@@ -354,37 +354,37 @@ class ShardedLRUCache : public Cache {
shard_[s].SetCapacity(per_shard);
}
}
- virtual ~ShardedLRUCache() {}
- virtual Handle* Insert(const Slice& key, void* value, size_t charge,
- void (*deleter)(const Slice& key, void* value)) {
+ ~ShardedLRUCache() override {}
+ Handle* Insert(const Slice& key, void* value, size_t charge,
+ void (*deleter)(const Slice& key, void* value)) override {
const uint32_t hash = HashSlice(key);
return shard_[Shard(hash)].Insert(key, hash, value, charge, deleter);
}
- virtual Handle* Lookup(const Slice& key) {
+ Handle* Lookup(const Slice& key) override {
const uint32_t hash = HashSlice(key);
return shard_[Shard(hash)].Lookup(key, hash);
}
- virtual void Release(Handle* handle) {
+ void Release(Handle* handle) override {
LRUHandle* h = reinterpret_cast<LRUHandle*>(handle);
shard_[Shard(h->hash)].Release(handle);
}
- virtual void Erase(const Slice& key) {
+ void Erase(const Slice& key) override {
const uint32_t hash = HashSlice(key);
shard_[Shard(hash)].Erase(key, hash);
}
- virtual void* Value(Handle* handle) {
+ void* Value(Handle* handle) override {
return reinterpret_cast<LRUHandle*>(handle)->value;
}
- virtual uint64_t NewId() {
+ uint64_t NewId() override {
MutexLock l(&id_mutex_);
return ++(last_id_);
}
- virtual void Prune() {
+ void Prune() override {
for (int s = 0; s < kNumShards; s++) {
shard_[s].Prune();
}
}
- virtual size_t TotalCharge() const {
+ size_t TotalCharge() const override {
size_t total = 0;
for (int s = 0; s < kNumShards; s++) {
total += shard_[s].TotalCharge();