diff --git a/include/rocksdb/cache.h b/include/rocksdb/cache.h index 27b4a6f64..dfdc374d0 100644 --- a/include/rocksdb/cache.h +++ b/include/rocksdb/cache.h @@ -255,7 +255,7 @@ class Cache { // Always delete the DB object before calling this method! virtual void DisownData(){ // default implementation is noop - }; + } // Apply callback to all entries in the cache // If thread_safe is true, it will also lock the accesses. Otherwise, it will diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index e70a49ffc..8c3d74ecc 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -672,7 +672,7 @@ class RandomAccessFile { virtual size_t GetUniqueId(char* /*id*/, size_t /*max_size*/) const { return 0; // Default implementation to prevent issues with backwards // compatibility. - }; + } enum AccessPattern { NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED }; @@ -1414,7 +1414,7 @@ class RandomAccessFileWrapper : public RandomAccessFile { } size_t GetUniqueId(char* id, size_t max_size) const override { return target_->GetUniqueId(id, max_size); - }; + } void Hint(AccessPattern pattern) override { target_->Hint(pattern); } bool use_direct_io() const override { return target_->use_direct_io(); } size_t GetRequiredBufferAlignment() const override { diff --git a/include/rocksdb/slice.h b/include/rocksdb/slice.h index 2b01e6d9a..00412bf3c 100644 --- a/include/rocksdb/slice.h +++ b/include/rocksdb/slice.h @@ -195,8 +195,15 @@ class PinnableSlice : public Slice, public Cleanable { } } - void remove_prefix(size_t /*n*/) { - assert(0); // Not implemented + void remove_prefix(size_t n) { + assert(n <= size()); + if (pinned_) { + data_ += n; + size_ -= n; + } else { + buf_->erase(0, n); + PinSelf(); + } } void Reset() { diff --git a/include/rocksdb/statistics.h b/include/rocksdb/statistics.h index b6b78ef99..d0fdf8acb 100644 --- a/include/rocksdb/statistics.h +++ b/include/rocksdb/statistics.h @@ -523,7 +523,7 @@ class Statistics { virtual bool getTickerMap(std::map*) const { // Do nothing by default return false; - }; + } // Override this function to disable particular histogram collection virtual bool HistEnabledForType(uint32_t type) const {