From a88ef0bed6c4b28a89d141e4349d4a2b16ed212d Mon Sep 17 00:00:00 2001 From: Louis Brandy Date: Fri, 16 Aug 2013 15:19:09 -0700 Subject: [PATCH] deprecating boost::shared_ptr Summary: Replacing boost::shared_ptr with std::shared_ptr. Test Plan: . Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D932119 --- folly/ConcurrentSkipList.h | 12 ++++++------ folly/test/ConcurrentSkipListBenchmark.cpp | 6 ++---- folly/test/ConcurrentSkipListTest.cpp | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/folly/ConcurrentSkipList.h b/folly/ConcurrentSkipList.h index 6c2a5006..295aab8c 100644 --- a/folly/ConcurrentSkipList.h +++ b/folly/ConcurrentSkipList.h @@ -129,7 +129,7 @@ Sample usage: #include #include #include -#include +#include #include #include "folly/ConcurrentSkipList-inl.h" @@ -166,8 +166,8 @@ class ConcurrentSkipList { } // create a shared_ptr skiplist object with initial head height. - static boost::shared_ptr createInstance(int height=1) { - return boost::shared_ptr(new SkipListType(height)); + static std::shared_ptr createInstance(int height=1) { + return std::shared_ptr(new SkipListType(height)); } // create a unique_ptr skiplist object with initial head height. @@ -593,7 +593,7 @@ class ConcurrentSkipList::Accessor { typedef typename SkipListType::const_iterator const_iterator; typedef typename SkipListType::Skipper Skipper; - explicit Accessor(boost::shared_ptr skip_list) + explicit Accessor(std::shared_ptr skip_list) : slHolder_(std::move(skip_list)) { sl_ = slHolder_.get(); @@ -704,7 +704,7 @@ class ConcurrentSkipList::Accessor { private: SkipListType *sl_; - boost::shared_ptr slHolder_; + std::shared_ptr slHolder_; }; // implements forward iterator concept. @@ -756,7 +756,7 @@ class ConcurrentSkipList::Skipper { typedef T* pointer; typedef ptrdiff_t difference_type; - Skipper(const boost::shared_ptr& skipList) : + Skipper(const std::shared_ptr& skipList) : accessor_(skipList) { init(); } diff --git a/folly/test/ConcurrentSkipListBenchmark.cpp b/folly/test/ConcurrentSkipListBenchmark.cpp index 78bfea5c..0eac9be1 100644 --- a/folly/test/ConcurrentSkipListBenchmark.cpp +++ b/folly/test/ConcurrentSkipListBenchmark.cpp @@ -20,8 +20,6 @@ #include #include -#include - #include #include #include "folly/Benchmark.h" @@ -468,12 +466,12 @@ class ConcurrentAccessData { std::vector deleteValues_; }; -static std::map > g_data; +static std::map > g_data; static ConcurrentAccessData *mayInitTestData(int size) { auto it = g_data.find(size); if (it == g_data.end()) { - auto ptr = boost::shared_ptr( + auto ptr = std::shared_ptr( new ConcurrentAccessData(size)); g_data[size] = ptr; return ptr.get(); diff --git a/folly/test/ConcurrentSkipListTest.cpp b/folly/test/ConcurrentSkipListTest.cpp index f20fa835..23c3edbc 100644 --- a/folly/test/ConcurrentSkipListTest.cpp +++ b/folly/test/ConcurrentSkipListTest.cpp @@ -218,7 +218,7 @@ static std::string makeRandomeString(int len) { TEST(ConcurrentSkipList, TestStringType) { typedef folly::ConcurrentSkipList SkipListT; - boost::shared_ptr skip = SkipListT::createInstance(); + std::shared_ptr skip = SkipListT::createInstance(); SkipListT::Accessor accessor(skip); { for (int i = 0; i < 100000; i++) { -- 2.34.1