diff --git a/port/port.h b/port/port.h index d3c5d6aa..dfbf6cd4 100644 --- a/port/port.h +++ b/port/port.h @@ -8,13 +8,8 @@ #include #include "leveldb/ldb_config.h" -// Include the appropriate platform specific file below. If you are -// porting to a new platform, see "port_example.h" for documentation -// of what the new port_.h file must provide. -#if defined(LEVELDB_PLATFORM_POSIX) -# include "port/port_posix.h" -#elif defined(LEVELDB_PLATFORM_CHROMIUM) -# include "port/port_chromium.h" -#endif +// there used to be more port_*.h, but everything seems to have become +// posix-compliant by now +#include "port/port_posix.h" #endif // STORAGE_LEVELDB_PORT_PORT_H_ diff --git a/table/table_test.cc b/table/table_test.cc index 4382c8e0..7b6e90f8 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -826,9 +826,9 @@ TEST(TableTest, ApproximateOffsetOfCompressed) { ASSERT_TRUE(Between(c.ApproximateOffsetOf("abc"), 0, 0)); ASSERT_TRUE(Between(c.ApproximateOffsetOf("k01"), 0, 0)); ASSERT_TRUE(Between(c.ApproximateOffsetOf("k02"), 0, 0)); - ASSERT_TRUE(Between(c.ApproximateOffsetOf("k03"), 2000, 3000)); - ASSERT_TRUE(Between(c.ApproximateOffsetOf("k04"), 2000, 3000)); - ASSERT_TRUE(Between(c.ApproximateOffsetOf("xyz"), 4000, 6000)); + ASSERT_TRUE(Between(c.ApproximateOffsetOf("k03"), 2000, 3500)); + ASSERT_TRUE(Between(c.ApproximateOffsetOf("k04"), 2000, 3500)); + ASSERT_TRUE(Between(c.ApproximateOffsetOf("xyz"), 4000, 6500)); } } // namespace leveldb diff --git a/tools/sst_rewrite.cc b/tools/sst_rewrite.cc index 49f23303..981c4e7f 100644 --- a/tools/sst_rewrite.cc +++ b/tools/sst_rewrite.cc @@ -223,8 +223,8 @@ main( { leveldb::WritableFile * outfile; leveldb::Status s; - std::auto_ptr it; - std::auto_ptr builder; + std::unique_ptr it; + std::unique_ptr builder; LDbTable in_file(options, fname); diff --git a/util/bloom.cc b/util/bloom.cc index 1cb63d1c..a9d97bf7 100644 --- a/util/bloom.cc +++ b/util/bloom.cc @@ -97,7 +97,7 @@ const FilterPolicy* NewBloomFilterPolicy(int bits_per_key) { // container to hold one bloom filter and auto destruct struct BloomInventoryItem { - std::auto_ptr m_Item; + std::unique_ptr m_Item; BloomInventoryItem() { diff --git a/util/bloom2.cc b/util/bloom2.cc index 5ffb2840..1d5f4030 100644 --- a/util/bloom2.cc +++ b/util/bloom2.cc @@ -111,7 +111,7 @@ const FilterPolicy* NewBloomFilterPolicy2(int bits_per_key) { // container to hold one bloom filter and auto destruct struct BloomInventoryItem2 { - std::auto_ptr m_Item; + std::unique_ptr m_Item; BloomInventoryItem2() { diff --git a/util/expiry_os_test.cc b/util/expiry_os_test.cc index 66c9a65a..d42e748b 100644 --- a/util/expiry_os_test.cc +++ b/util/expiry_os_test.cc @@ -1451,7 +1451,7 @@ TEST(ExpiryDBTester, Simple) Status s; sExpiryDBObject * cursor; std::string buffer; - std::auto_ptr iterator; + std::unique_ptr iterator; // enable compaction expiry m_Expiry->expiry_enabled=true; diff --git a/util/perf_count.cc b/util/perf_count.cc index ac6aaa28..73419405 100644 --- a/util/perf_count.cc +++ b/util/perf_count.cc @@ -353,20 +353,8 @@ PerformanceCounters * gPerfCounters(&LocalStartupCounters); val_ptr=&m_Counter[Index]; -# if ULONG_MAX != 4294967295UL inc_and_fetch(val_ptr); -#else - // hack fest for 64 bit semi-atomic on 32bit machine - uint32_t ret_32, * ptr_32; - ptr_32=(uint32_t *)&val_ptr; - ret_32=inc_and_fetch(ptr_32, 1); - if (0==ret_32) - { - ++ptr_32; - inc_and_fetch(ptr_32, 1); - } // if -#endif ret_val=*val_ptr; } // if @@ -388,20 +376,8 @@ PerformanceCounters * gPerfCounters(&LocalStartupCounters); val_ptr=&m_Counter[Index]; -# if ULONG_MAX != 4294967295UL dec_and_fetch(val_ptr); -#else - // hack fest for 64 bit semi-atomic on 32bit machine - uint32_t ret_32, * ptr_32; - ptr_32=(uint32_t *)&val_ptr; - ret_32=dec_and_fetch(ptr_32); - if (0xFFFFFFFF==ret_32) - { - ++ptr_32; - dec_and_fetch(ptr_32); - } // if -#endif ret_val=*val_ptr; } // if @@ -424,23 +400,7 @@ PerformanceCounters * gPerfCounters(&LocalStartupCounters); val_ptr=&m_Counter[Index]; -# if ULONG_MAX != 4294967295UL ret_val=add_and_fetch(val_ptr, Amount); -#else - // hack fest for 64 bit semi-atomic on 32bit machine - uint32_t old_32, ret_32, * ptr_32; - - ptr_32=(uint32_t *)&val_ptr; - old_32=*ptr_32; - ret_32=add_and_fetch(ptr_32, Amount); - if (ret_32