Update src/rocksdb2 to rocksdb-3.5.1:

Merge commit 'c168d54495d7d7b84639514f6443ad99b89ce996' into develop
This commit is contained in:
Vinnie Falco
2014-10-27 11:36:32 -07:00
195 changed files with 4433 additions and 9442 deletions

View File

@@ -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)) {