diff --git a/cache/lru_cache_test.cc b/cache/lru_cache_test.cc index 3a6ce96a4..50b05c2ee 100644 --- a/cache/lru_cache_test.cc +++ b/cache/lru_cache_test.cc @@ -221,8 +221,8 @@ class TestNvmCache : public NvmCache { s = (*save_cb)(value, 0, size, buf + sizeof(uint64_t)); EXPECT_OK(s); return cache_->Insert(key, buf, size, - [](const Slice& /*key*/, void* value) -> void { - delete[] reinterpret_cast(value); + [](const Slice& /*key*/, void* val) -> void { + delete[] reinterpret_cast(val); }); } @@ -263,7 +263,6 @@ class TestNvmCache : public NvmCache { size_t size) : cache_(cache), handle_(handle), value_(value), size_(size) {} ~TestNvmCacheHandle() { - delete[] reinterpret_cast(cache_->Value(handle_)); cache_->Release(handle_); } diff --git a/db/db_test_util.h b/db/db_test_util.h index 0c294f786..f268e0111 100644 --- a/db/db_test_util.h +++ b/db/db_test_util.h @@ -826,6 +826,7 @@ class CacheWrapper : public Cache { const char* Name() const override { return target_->Name(); } + using Cache::Insert; Status Insert(const Slice& key, void* value, size_t charge, void (*deleter)(const Slice& key, void* value), Handle** handle = nullptr, @@ -833,12 +834,14 @@ class CacheWrapper : public Cache { return target_->Insert(key, value, charge, deleter, handle, priority); } + using Cache::Lookup; Handle* Lookup(const Slice& key, Statistics* stats = nullptr) override { return target_->Lookup(key, stats); } bool Ref(Handle* handle) override { return target_->Ref(handle); } + using Cache::Release; bool Release(Handle* handle, bool force_erase = false) override { return target_->Release(handle, force_erase); } diff --git a/utilities/simulator_cache/sim_cache.cc b/utilities/simulator_cache/sim_cache.cc index 0da71ab16..f957a70fc 100644 --- a/utilities/simulator_cache/sim_cache.cc +++ b/utilities/simulator_cache/sim_cache.cc @@ -167,6 +167,7 @@ class SimCacheImpl : public SimCache { cache_->SetStrictCapacityLimit(strict_capacity_limit); } + using Cache::Insert; Status Insert(const Slice& key, void* value, size_t charge, void (*deleter)(const Slice& key, void* value), Handle** handle, Priority priority) override { @@ -193,6 +194,7 @@ class SimCacheImpl : public SimCache { return cache_->Insert(key, value, charge, deleter, handle, priority); } + using Cache::Lookup; Handle* Lookup(const Slice& key, Statistics* stats) override { Handle* h = key_only_cache_->Lookup(key); if (h != nullptr) { @@ -213,6 +215,7 @@ class SimCacheImpl : public SimCache { bool Ref(Handle* handle) override { return cache_->Ref(handle); } + using Cache::Release; bool Release(Handle* handle, bool force_erase = false) override { return cache_->Release(handle, force_erase); }