From: Christopher Dykes Date: Mon, 23 Oct 2017 23:52:19 +0000 (-0700) Subject: Modernize uses of std::make_shared X-Git-Tag: v2017.10.30.00~24 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d21f716525c0b0a8aec9725ea39dc2a695267875;p=folly.git Modernize uses of std::make_shared Summary: Via the modernize-make-shared from clang-tidy Reviewed By: yfeldblum Differential Revision: D6129464 fbshipit-source-id: 04f560c6beeb2b8631b819fd4e6a2d51b37eeb4b --- diff --git a/folly/io/async/test/AsyncSocketTest.h b/folly/io/async/test/AsyncSocketTest.h index 95f302e4..f8c03f88 100644 --- a/folly/io/async/test/AsyncSocketTest.h +++ b/folly/io/async/test/AsyncSocketTest.h @@ -20,6 +20,7 @@ #include #include +#include enum StateEnum { STATE_WAITING, @@ -370,7 +371,7 @@ class TestServer { std::shared_ptr accept(int timeout=50) { int fd = acceptFD(timeout); - return std::shared_ptr(new BlockingSocket(fd)); + return std::make_shared(fd); } std::shared_ptr acceptAsync(folly::EventBase* evb, diff --git a/folly/test/ConcurrentSkipListBenchmark.cpp b/folly/test/ConcurrentSkipListBenchmark.cpp index 09b9d17b..020a7bf7 100644 --- a/folly/test/ConcurrentSkipListBenchmark.cpp +++ b/folly/test/ConcurrentSkipListBenchmark.cpp @@ -17,6 +17,7 @@ // @author: Xin Liu #include +#include #include #include #include @@ -485,8 +486,7 @@ static std::map > g_data; static ConcurrentAccessData *mayInitTestData(int size) { auto it = g_data.find(size); if (it == g_data.end()) { - auto ptr = std::shared_ptr( - new ConcurrentAccessData(size)); + auto ptr = std::make_shared(size); g_data[size] = ptr; return ptr.get(); }