]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix win build rocksdb-4.8 v4.8
authorYi Wu <yiwu@fb.com>
Mon, 9 May 2016 18:52:28 +0000 (11:52 -0700)
committerYi Wu <yiwu@fb.com>
Mon, 9 May 2016 20:43:05 +0000 (13:43 -0700)
Summary: Fixing error with win build where we compare int64_t with size_t.

Test Plan: make check

Reviewers: andrewkr

Reviewed By: andrewkr

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D57885

db/db_iterator_test.cc
db/db_test_util.h

index bb771554f092166334a6a6aa2a87c1a72cbcf2b0..bc40a1790c62e74a9008c62efe5af63065ea6256 100644 (file)
@@ -1566,7 +1566,7 @@ TEST_F(DBIteratorTest, ReadAhead) {
   auto* iter = db_->NewIterator(read_options);
   iter->SeekToFirst();
   int64_t num_file_opens = TestGetTickerCount(options, NO_FILE_OPENS);
-  int64_t bytes_read = env_->random_read_bytes_counter_;
+  size_t bytes_read = env_->random_read_bytes_counter_;
   delete iter;
 
   env_->random_read_bytes_counter_ = 0;
@@ -1575,7 +1575,7 @@ TEST_F(DBIteratorTest, ReadAhead) {
   iter = db_->NewIterator(read_options);
   iter->SeekToFirst();
   int64_t num_file_opens_readahead = TestGetTickerCount(options, NO_FILE_OPENS);
-  int64_t bytes_read_readahead = env_->random_read_bytes_counter_;
+  size_t bytes_read_readahead = env_->random_read_bytes_counter_;
   delete iter;
   ASSERT_EQ(num_file_opens + 3, num_file_opens_readahead);
   ASSERT_GT(bytes_read_readahead, bytes_read);
index 4f2cea29cbfcc2c0061c5bc2bb097a70770e814c..8aba1e5d79545770c6e57d4c6a9ba9c314c92360 100644 (file)
@@ -359,7 +359,7 @@ class SpecialEnv : public EnvWrapper {
      public:
       CountingFile(unique_ptr<RandomAccessFile>&& target,
                    anon::AtomicCounter* counter,
-                   std::atomic<int64_t>* bytes_read)
+                   std::atomic<size_t>* bytes_read)
           : target_(std::move(target)),
             counter_(counter),
             bytes_read_(bytes_read) {}
@@ -374,7 +374,7 @@ class SpecialEnv : public EnvWrapper {
      private:
       unique_ptr<RandomAccessFile> target_;
       anon::AtomicCounter* counter_;
-      std::atomic<int64_t>* bytes_read_;
+      std::atomic<size_t>* bytes_read_;
     };
 
     Status s = target()->NewRandomAccessFile(f, r, soptions);
@@ -471,7 +471,7 @@ class SpecialEnv : public EnvWrapper {
 
   bool count_random_reads_;
   anon::AtomicCounter random_read_counter_;
-  std::atomic<int64_t> random_read_bytes_counter_;
+  std::atomic<size_t> random_read_bytes_counter_;
   std::atomic<int> random_file_open_counter_;
 
   bool count_sequential_reads_;