Fixed unit test c_test by initializing logger=NULL.

Summary:
Fixed unit test c_test by initializing logger=NULL.

Removed "atomic" from last_log_ts so that unit tests do not require C11 compiler.
Anyway, last_log_ts is mostly used for logging, so it is ok if it is loosely
accurate.

Test Plan: run c_test

Reviewers: heyongqiang

Reviewed By: heyongqiang

Differential Revision: https://reviews.facebook.net/D4803
main
Dhruba Borthakur 12 years ago
parent 407f020929
commit a098207c95
  1. 3
      db/db_impl.cc
  2. 3
      db/db_impl.h

@ -134,7 +134,8 @@ DBImpl::DBImpl(const Options& options, const std::string& dbname)
log_(NULL), log_(NULL),
tmp_batch_(new WriteBatch), tmp_batch_(new WriteBatch),
bg_compaction_scheduled_(false), bg_compaction_scheduled_(false),
manual_compaction_(NULL) { manual_compaction_(NULL),
logger_(NULL) {
mem_->Ref(); mem_->Ref();
has_imm_.Release_Store(NULL); has_imm_.Release_Store(NULL);

@ -7,7 +7,6 @@
#include <deque> #include <deque>
#include <set> #include <set>
#include <atomic>
#include "db/dbformat.h" #include "db/dbformat.h"
#include "db/log_writer.h" #include "db/log_writer.h"
#include "db/snapshot.h" #include "db/snapshot.h"
@ -187,7 +186,7 @@ class DBImpl : public DB {
StatsLogger* logger_; StatsLogger* logger_;
std::atomic<int64_t> last_log_ts; int64_t volatile last_log_ts;
// Per level compaction stats. stats_[level] stores the stats for // Per level compaction stats. stats_[level] stores the stats for
// compactions that produced data for the specified "level". // compactions that produced data for the specified "level".

Loading…
Cancel
Save