mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Update src/rocksdb2 to rocksdb-3.5.1:
Merge commit 'c168d54495d7d7b84639514f6443ad99b89ce996' into develop
This commit is contained in:
@@ -297,10 +297,12 @@ uint32_t Block::NumRestarts() const {
|
||||
return DecodeFixed32(data_ + size_ - sizeof(uint32_t));
|
||||
}
|
||||
|
||||
Block::Block(BlockContents&& contents)
|
||||
: contents_(std::move(contents)),
|
||||
data_(contents_.data.data()),
|
||||
size_(contents_.data.size()) {
|
||||
Block::Block(const BlockContents& contents)
|
||||
: data_(contents.data.data()),
|
||||
size_(contents.data.size()),
|
||||
owned_(contents.heap_allocated),
|
||||
cachable_(contents.cachable),
|
||||
compression_type_(contents.compression_type) {
|
||||
if (size_ < sizeof(uint32_t)) {
|
||||
size_ = 0; // Error marker
|
||||
} else {
|
||||
@@ -313,6 +315,12 @@ Block::Block(BlockContents&& contents)
|
||||
}
|
||||
}
|
||||
|
||||
Block::~Block() {
|
||||
if (owned_) {
|
||||
delete[] data_;
|
||||
}
|
||||
}
|
||||
|
||||
Iterator* Block::NewIterator(
|
||||
const Comparator* cmp, BlockIter* iter, bool total_order_seek) {
|
||||
if (size_ < 2*sizeof(uint32_t)) {
|
||||
|
||||
Reference in New Issue
Block a user