Fix some build and test failures

This commit is contained in:
anand76 2021-03-29 14:28:04 -07:00
parent 1e0b641048
commit abe8a29a37
3 changed files with 8 additions and 3 deletions

View File

@ -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<char*>(value);
[](const Slice& /*key*/, void* val) -> void {
delete[] reinterpret_cast<char*>(val);
});
}
@ -263,7 +263,6 @@ class TestNvmCache : public NvmCache {
size_t size)
: cache_(cache), handle_(handle), value_(value), size_(size) {}
~TestNvmCacheHandle() {
delete[] reinterpret_cast<char*>(cache_->Value(handle_));
cache_->Release(handle_);
}

View File

@ -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);
}

View File

@ -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);
}