Simplified level_ptrs by using a std:vector

Summary: Simplified level_ptrs by using a std:vector

Test Plan: make check

Reviewers: sheki, emayanke

Reviewed By: emayanke

CC: leveldb

Differential Revision: https://reviews.facebook.net/D10245
main
Dhruba Borthakur 12 years ago
parent 013e9ebbf1
commit 9b81d3c406
  1. 5
      db/version_set.cc
  2. 2
      db/version_set.h

@ -2169,16 +2169,15 @@ Compaction::Compaction(int level, uint64_t target_file_size,
overlapped_bytes_(0),
base_index_(-1),
parent_index_(-1),
score_(0) {
score_(0),
level_ptrs_(std::vector<size_t>(number_levels)) {
edit_ = new VersionEdit(number_levels_);
level_ptrs_ = new size_t[number_levels_];
for (int i = 0; i < number_levels_; i++) {
level_ptrs_[i] = 0;
}
}
Compaction::~Compaction() {
delete[] level_ptrs_;
delete edit_;
if (input_version_ != nullptr) {
input_version_->Unref();

@ -567,7 +567,7 @@ class Compaction {
// is that we are positioned at one of the file ranges for each
// higher level than the ones involved in this compaction (i.e. for
// all L >= level_ + 2).
size_t* level_ptrs_;
std::vector<size_t> level_ptrs_;
// mark (or clear) all files that are being compacted
void MarkFilesBeingCompacted(bool);

Loading…
Cancel
Save