From 191d9eaaac9bd123fa87308845fc8e6d17430da1 Mon Sep 17 00:00:00 2001 From: George Kulakowski <kulakowski@google.com> Date: Thu, 11 Apr 2019 03:40:50 +0000 Subject: [PATCH] [fbl] Migrate to std::make_unique and remove fbl::make_unique fbl::make_unique was functionally identical to std::make_unique. There should be no behavior change in this CL. The bulk of this CL was prepared via the following zsh script: for f in $(git grep -l 'fbl::make_unique<') ; \ sed -i 's/fbl::make_unique</std::make_unique</' $f Bug: ZX-3357 #comment remove make_unique Bug: ZX-3837 #comment remove make_unique Change-Id: Ic8bf489e4dbf7cb7d2d71ad95aa26018bf776e56 --- .../inspect_unittests/vmo_reader_unittest.cc | 2 +- .../drivers/usb_video/camera_control_impl.cpp | 2 +- garnet/drivers/usb_video/usb-video-stream.cpp | 4 +- .../drivers/wlan/tests/minstrel_unittest.cpp | 2 +- .../wlan/lib/mlme/cpp/ap/ap_mlme.cpp | 2 +- .../wlan/lib/mlme/cpp/ap/infra_bss.cpp | 2 +- .../wlan/lib/mlme/cpp/ap/remote_client.cpp | 4 +- .../lib/mlme/cpp/client/client_factory.cpp | 2 +- src/connectivity/wlan/lib/mlme/cpp/packet.cpp | 2 +- .../cpp/tests/channel_scheduler_unittest.cpp | 4 +- .../cpp/tests/frame_validation_unittest.cpp | 2 +- .../wlan/lib/mlme/cpp/tests/hwmp_unittest.cpp | 2 +- .../lib/mlme/cpp/tests/mac_frame_unittest.cpp | 2 +- .../wlan/lib/mlme/cpp/tests/mock_device.h | 2 +- .../lib/mlme/cpp/tests/scanner_unittest.cpp | 2 +- .../mlme/cpp/tests/timer_manager_unittest.cpp | 4 +- .../graph/payloads/vmo_payload_allocator.cc | 2 +- zircon/system/core/bootsvc/main.cpp | 2 +- zircon/system/core/bootsvc/util.cpp | 2 +- .../devmgr/devcoordinator/coordinator.cpp | 2 +- .../core/devmgr/devcoordinator/devfs.cpp | 8 ++-- .../core/devmgr/devcoordinator/driver.cpp | 4 +- .../core/devmgr/devcoordinator/fidl-proxy.cpp | 2 +- zircon/system/core/devmgr/devhost/devhost.cpp | 14 +++--- zircon/system/core/devmgr/devhost/devhost.h | 2 +- .../system/core/devmgr/devhost/rpc-server.cpp | 2 +- zircon/system/core/devmgr/dmctl/dmctl.cpp | 2 +- zircon/system/core/devmgr/fshost/main.cpp | 2 +- zircon/system/core/devmgr/fshost/vfs-rpc.cpp | 2 +- .../dev/block/aml-sd-emmc/aml-sd-emmc.cpp | 2 +- zircon/system/dev/block/fvm/fvm.cpp | 2 +- zircon/system/dev/block/fvm/vpartition.cpp | 2 +- zircon/system/dev/bus/pci/allocation.cpp | 2 +- zircon/system/dev/bus/virtio/scsi_test.cpp | 2 +- zircon/system/dev/clk/amlogic-clk/aml-clk.cpp | 2 +- zircon/system/dev/ethernet/dwmac/dwmac.cpp | 2 +- .../system/dev/input/focaltech/ft_device.cpp | 2 +- zircon/system/dev/input/goodix/gt92xx.cpp | 2 +- .../dev/light-sensor/ams-light/tcs3400.cpp | 2 +- zircon/system/dev/misc/test/test.cpp | 4 +- .../nand/nandpart/test/aml-bad-block-test.cpp | 44 +++++++++---------- .../dev/pci/amlogic-pcie/aml-pcie-device.cpp | 2 +- .../dev/power/msm8x53-power/msm8x53-power.cpp | 2 +- .../system/dev/power/mtk-power/mtk-power.cpp | 2 +- zircon/system/dev/rtc/fallback/rtc-impl.cpp | 2 +- .../sysmem/amlogic_memory_allocator.cpp | 2 +- zircon/system/dev/sysmem/sysmem/device.cpp | 2 +- zircon/system/dev/tee/optee/optee-client.cpp | 2 +- .../system/dev/tee/optee/optee-controller.cpp | 2 +- zircon/system/dev/test/mock-device/device.cpp | 4 +- zircon/system/dev/test/mock-device/fidl.cpp | 2 +- zircon/system/dev/test/sysdev/sysdev.cpp | 2 +- .../thermal/aml-thermal-s912/aml-thermal.cpp | 2 +- zircon/system/host/fvm/mtd.cpp | 2 +- .../system/ulib/async-testutils/test_loop.cpp | 6 +-- .../async-testutils/test_loop_dispatcher.cpp | 4 +- zircon/system/ulib/blobfs/blob.cpp | 2 +- zircon/system/ulib/blobfs/blobfs.cpp | 2 +- zircon/system/ulib/blobfs/directory.cpp | 2 +- zircon/system/ulib/blobfs/journal.cpp | 2 +- .../system/ulib/blobfs/test/journal-test.cpp | 2 +- zircon/system/ulib/blobfs/test/utils.cpp | 2 +- .../system/ulib/ddktl/test/ethernet-tests.cpp | 2 +- .../ulib/devmgr-integration-test/launcher.cpp | 2 +- zircon/system/ulib/fbl/include/fbl/function.h | 2 +- .../system/ulib/fbl/include/fbl/unique_ptr.h | 14 ------ zircon/system/ulib/fs/pseudo-dir.cpp | 2 +- zircon/system/ulib/fs/vnode.cpp | 2 +- zircon/system/ulib/fvm-host/file-wrapper.cpp | 2 +- zircon/system/ulib/fvm-host/fvm-info.cpp | 2 +- .../include/lib/inspect-vmo/snapshot.h | 2 +- .../ulib/kms-stateless/kms-stateless.cpp | 2 +- zircon/system/ulib/memfs/memfs-local.cpp | 2 +- zircon/system/ulib/minfs/vnode.cpp | 2 +- zircon/system/ulib/trace-provider/session.cpp | 2 +- zircon/system/ulib/trace-reader/reader.cpp | 6 +-- .../utest/async-testutils/test_loop_tests.cpp | 2 +- .../cobalt-client/cobalt_logger_test.cpp | 4 +- zircon/system/utest/core/pager/pager.cpp | 18 ++++---- zircon/system/utest/core/pager/userpager.cpp | 2 +- zircon/system/utest/fbl/function_tests.cpp | 2 +- zircon/system/utest/fbl/unique_ptr_tests.cpp | 4 +- .../system/utest/fs-vnode/teardown-tests.cpp | 10 ++--- .../utest/inspect-vmo/inspect_tests.cpp | 2 +- .../system/utest/inspect-vmo/state_tests.cpp | 30 ++++++------- .../utest/libfzl/owned-vmo-mapper-tests.cpp | 2 +- zircon/system/utest/logger/test.cpp | 2 +- .../runtests-utils/log-exporter-test.cpp | 6 +-- 88 files changed, 159 insertions(+), 173 deletions(-) diff --git a/garnet/bin/inspect_unittests/vmo_reader_unittest.cc b/garnet/bin/inspect_unittests/vmo_reader_unittest.cc index 0421eac7301..7ff70a8f515 100644 --- a/garnet/bin/inspect_unittests/vmo_reader_unittest.cc +++ b/garnet/bin/inspect_unittests/vmo_reader_unittest.cc @@ -23,7 +23,7 @@ using namespace inspect::testing; namespace { TEST(VmoReader, CreateAndReadObjectHierarchy) { - auto inspector = fbl::make_unique<inspect::vmo::Inspector>(); + auto inspector = std::make_unique<inspect::vmo::Inspector>(); ASSERT_TRUE(inspector); Object object = inspector->CreateObject("objects"); diff --git a/garnet/drivers/usb_video/camera_control_impl.cpp b/garnet/drivers/usb_video/camera_control_impl.cpp index 7d2919d2ad1..be090de6ebb 100644 --- a/garnet/drivers/usb_video/camera_control_impl.cpp +++ b/garnet/drivers/usb_video/camera_control_impl.cpp @@ -76,7 +76,7 @@ void ControlImpl::CreateStream( return; } - stream_ = fbl::make_unique<StreamImpl>(*this, std::move(stream), + stream_ = std::make_unique<StreamImpl>(*this, std::move(stream), std::move(stream_token)); } diff --git a/garnet/drivers/usb_video/usb-video-stream.cpp b/garnet/drivers/usb_video/usb-video-stream.cpp index 10843f496da..33b197e4616 100644 --- a/garnet/drivers/usb_video/usb-video-stream.cpp +++ b/garnet/drivers/usb_video/usb-video-stream.cpp @@ -51,7 +51,7 @@ UsbVideoStream::UsbVideoStream(zx_device_t* parent, usb_protocol_t* usb, device_info_(std::move(device_info)) { if (fidl_dispatch_loop_ == nullptr) { fidl_dispatch_loop_ = - fbl::make_unique<async::Loop>(&kAsyncLoopConfigNoAttachToThread); + std::make_unique<async::Loop>(&kAsyncLoopConfigNoAttachToThread); fidl_dispatch_loop_->StartThread(); } } @@ -293,7 +293,7 @@ zx_status_t UsbVideoStream::GetChannel(zx_handle_t handle) { return ZX_ERR_INVALID_ARGS; } fidl::InterfaceRequest<fuchsia::camera::Control> control_interface(std::move(channel)); - camera_control_ = fbl::make_unique<camera::ControlImpl>( + camera_control_ = std::make_unique<camera::ControlImpl>( this, std::move(control_interface), fidl_dispatch_loop_->dispatcher(), [this] { fbl::AutoLock lock(&lock_); diff --git a/src/connectivity/wlan/drivers/wlan/tests/minstrel_unittest.cpp b/src/connectivity/wlan/drivers/wlan/tests/minstrel_unittest.cpp index 8adf2fe4b0b..b3c373f3160 100644 --- a/src/connectivity/wlan/drivers/wlan/tests/minstrel_unittest.cpp +++ b/src/connectivity/wlan/drivers/wlan/tests/minstrel_unittest.cpp @@ -34,7 +34,7 @@ static const uint8_t kBasicRateBit = 0b10000000; struct MinstrelTest : public ::testing::Test { MinstrelTest() - : minstrel_(MinstrelRateSelector(fbl::make_unique<TestTimer>(0, &clock), + : minstrel_(MinstrelRateSelector(std::make_unique<TestTimer>(0, &clock), ProbeSequence(SequentialTable()), zx::msec(100))) { kTestMacAddr.CopyTo(assoc_ctx_ht_.bssid); } diff --git a/src/connectivity/wlan/lib/mlme/cpp/ap/ap_mlme.cpp b/src/connectivity/wlan/lib/mlme/cpp/ap/ap_mlme.cpp index 471accb6204..5f1da65fbc3 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/ap/ap_mlme.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/ap/ap_mlme.cpp @@ -87,7 +87,7 @@ zx_status_t ApMlme::HandleMlmeStartReq(const MlmeMsg<wlan_mlme::StartRequest>& r device_->ConfigureBss(&cfg); // Create and start BSS. - auto bcn_sender = fbl::make_unique<BeaconSender>(device_); + auto bcn_sender = std::make_unique<BeaconSender>(device_); bss_.reset(new InfraBss(device_, std::move(bcn_sender), bssid, std::move(timer))); bss_->Start(req); diff --git a/src/connectivity/wlan/lib/mlme/cpp/ap/infra_bss.cpp b/src/connectivity/wlan/lib/mlme/cpp/ap/infra_bss.cpp index d2a54e875be..381de1f86cc 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/ap/infra_bss.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/ap/infra_bss.cpp @@ -262,7 +262,7 @@ void InfraBss::HandleNewClientAuthAttempt(const MgmtFrameView<Authentication>& f client_addr.ToString().c_str()); // Else, create a new remote client instance. - auto client = fbl::make_unique<RemoteClient>(device_, + auto client = std::make_unique<RemoteClient>(device_, this, // bss this, // client listener client_addr); diff --git a/src/connectivity/wlan/lib/mlme/cpp/ap/remote_client.cpp b/src/connectivity/wlan/lib/mlme/cpp/ap/remote_client.cpp index b46433e72e6..9298913b9c0 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/ap/remote_client.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/ap/remote_client.cpp @@ -26,7 +26,7 @@ namespace wlan_mlme = ::fuchsia::wlan::mlme; template <typename S, typename... Args> void BaseState::MoveToState(Args&&... args) { static_assert(std::is_base_of<BaseState, S>::value, "State class must implement BaseState"); - client_->MoveToState(fbl::make_unique<S>(client_, std::forward<Args>(args)...)); + client_->MoveToState(std::make_unique<S>(client_, std::forward<Args>(args)...)); } // Deauthenticating implementation. @@ -705,7 +705,7 @@ RemoteClient::RemoteClient(DeviceInterface* device, BssInterface* bss, debugbss("[client] [%s] spawned\n", addr_.ToString().c_str()); MoveToState( - fbl::make_unique<DeauthenticatedState>(this, DeauthenticatedState::MoveReason::INIT)); + std::make_unique<DeauthenticatedState>(this, DeauthenticatedState::MoveReason::INIT)); } RemoteClient::~RemoteClient() { diff --git a/src/connectivity/wlan/lib/mlme/cpp/client/client_factory.cpp b/src/connectivity/wlan/lib/mlme/cpp/client/client_factory.cpp index f96a35b6878..5ee70634766 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/client/client_factory.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/client/client_factory.cpp @@ -21,7 +21,7 @@ fbl::unique_ptr<ClientInterface> CreateDefaultClient(DeviceInterface* device, Jo errorf("could not create STA timer: %d\n", status); return nullptr; } - return fbl::make_unique<Station>(device, TimerManager<>(std::move(timer)), chan_scheduler, + return std::make_unique<Station>(device, TimerManager<>(std::move(timer)), chan_scheduler, join_ctx); } diff --git a/src/connectivity/wlan/lib/mlme/cpp/packet.cpp b/src/connectivity/wlan/lib/mlme/cpp/packet.cpp index 51d349d4f34..3f924f49c76 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/packet.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/packet.cpp @@ -103,7 +103,7 @@ fbl::unique_ptr<Buffer> GetBuffer(size_t len) { fbl::unique_ptr<Packet> GetPacket(size_t len, Packet::Peer peer) { auto buffer = GetBuffer(len); if (buffer == nullptr) { return nullptr; } - auto packet = fbl::make_unique<Packet>(std::move(buffer), len); + auto packet = std::make_unique<Packet>(std::move(buffer), len); packet->set_peer(peer); return packet; } diff --git a/src/connectivity/wlan/lib/mlme/cpp/tests/channel_scheduler_unittest.cpp b/src/connectivity/wlan/lib/mlme/cpp/tests/channel_scheduler_unittest.cpp index 640ab02f324..1dbeec808e6 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/tests/channel_scheduler_unittest.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/tests/channel_scheduler_unittest.cpp @@ -57,7 +57,7 @@ struct MockOffChannelHandler : OffChannelHandler { }; TEST_F(ChannelSchedulerTest, OnChannelFrame) { - chan_sched_.HandleIncomingFrame(fbl::make_unique<Packet>(GetBuffer(10), 10)); + chan_sched_.HandleIncomingFrame(std::make_unique<Packet>(GetBuffer(10), 10)); EXPECT_EQ("frame_on,", str_); } @@ -70,7 +70,7 @@ TEST_F(ChannelSchedulerTest, RequestOffChannelTime) { EXPECT_EQ(7u, device_.GetChannelNumber()); str_.clear(); - chan_sched_.HandleIncomingFrame(fbl::make_unique<Packet>(GetBuffer(10), 10)); + chan_sched_.HandleIncomingFrame(std::make_unique<Packet>(GetBuffer(10), 10)); EXPECT_EQ("frame_off,", str_); str_.clear(); diff --git a/src/connectivity/wlan/lib/mlme/cpp/tests/frame_validation_unittest.cpp b/src/connectivity/wlan/lib/mlme/cpp/tests/frame_validation_unittest.cpp index a20aad6b895..d28765d6042 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/tests/frame_validation_unittest.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/tests/frame_validation_unittest.cpp @@ -48,7 +48,7 @@ struct DynamicTestHdr { static fbl::unique_ptr<Packet> GetPacket(size_t len) { auto buffer = GetBuffer(len); - auto pkt = fbl::make_unique<Packet>(std::move(buffer), len); + auto pkt = std::make_unique<Packet>(std::move(buffer), len); pkt->clear(); return pkt; } diff --git a/src/connectivity/wlan/lib/mlme/cpp/tests/hwmp_unittest.cpp b/src/connectivity/wlan/lib/mlme/cpp/tests/hwmp_unittest.cpp index 0b5fadc45e3..d5b9b40b8a2 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/tests/hwmp_unittest.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/tests/hwmp_unittest.cpp @@ -31,7 +31,7 @@ TEST(Hwmp, HwmpSeqnoLessThan) { } struct HwmpTest : public ::testing::Test { - HwmpTest() : state(fbl::make_unique<TestTimer>(123, &clock)) { clock.Set(zx::time(1000)); } + HwmpTest() : state(std::make_unique<TestTimer>(123, &clock)) { clock.Set(zx::time(1000)); } MacHeaderWriter CreateMacHeaderWriter() { return MacHeaderWriter(self_addr(), seq_mgr.get()); } diff --git a/src/connectivity/wlan/lib/mlme/cpp/tests/mac_frame_unittest.cpp b/src/connectivity/wlan/lib/mlme/cpp/tests/mac_frame_unittest.cpp index 612de871812..66d649cf5d7 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/tests/mac_frame_unittest.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/tests/mac_frame_unittest.cpp @@ -75,7 +75,7 @@ template <size_t padding_len, size_t payload_len> struct TripleHdrFrame { static fbl::unique_ptr<Packet> GetPacket(size_t len) { auto buffer = GetBuffer(len); memset(buffer->data(), 0, len); - return fbl::make_unique<Packet>(std::move(buffer), len); + return std::make_unique<Packet>(std::move(buffer), len); } using DefaultTripleHdrFrame = TripleHdrFrame<0, 10>; diff --git a/src/connectivity/wlan/lib/mlme/cpp/tests/mock_device.h b/src/connectivity/wlan/lib/mlme/cpp/tests/mock_device.h index d109a26e6fd..e3e56b861e8 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/tests/mock_device.h +++ b/src/connectivity/wlan/lib/mlme/cpp/tests/mock_device.h @@ -65,7 +65,7 @@ struct MockDevice : public DeviceInterface { } fbl::unique_ptr<Timer> CreateTimer(uint64_t id) { - return fbl::make_unique<TestTimer>(id, &clock_); + return std::make_unique<TestTimer>(id, &clock_); } zx_status_t DeliverEthernet(Span<const uint8_t> eth_frame) override final { diff --git a/src/connectivity/wlan/lib/mlme/cpp/tests/scanner_unittest.cpp b/src/connectivity/wlan/lib/mlme/cpp/tests/scanner_unittest.cpp index 04af27ec5ba..39a5f98f4dc 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/tests/scanner_unittest.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/tests/scanner_unittest.cpp @@ -82,7 +82,7 @@ class ScannerTest : public ::testing::Test { info.snr_dbh = 30; auto buffer = GetBuffer(data.size()); - auto packet = fbl::make_unique<Packet>(std::move(buffer), data.size()); + auto packet = std::make_unique<Packet>(std::move(buffer), data.size()); packet->CopyCtrlFrom(info); memcpy(packet->mut_field<uint8_t*>(0), data.data(), data.size()); return packet; diff --git a/src/connectivity/wlan/lib/mlme/cpp/tests/timer_manager_unittest.cpp b/src/connectivity/wlan/lib/mlme/cpp/tests/timer_manager_unittest.cpp index 71a4a4eaef1..895b3f2b80e 100644 --- a/src/connectivity/wlan/lib/mlme/cpp/tests/timer_manager_unittest.cpp +++ b/src/connectivity/wlan/lib/mlme/cpp/tests/timer_manager_unittest.cpp @@ -43,9 +43,9 @@ class MockedTimer : public Timer { struct TimerManagerTest : public ::testing::Test { TimerManagerTest() { - auto timer_box = fbl::make_unique<MockedTimer>(); + auto timer_box = std::make_unique<MockedTimer>(); timer = timer_box.get(); - timer_manager = fbl::make_unique<TimerManager<std::string>>(std::move(timer_box)); + timer_manager = std::make_unique<TimerManager<std::string>>(std::move(timer_box)); } timekeeper::TestClock* clock() { return &timer->clock; } diff --git a/src/media/playback/mediaplayer/graph/payloads/vmo_payload_allocator.cc b/src/media/playback/mediaplayer/graph/payloads/vmo_payload_allocator.cc index 26c4b08814e..f8fe3efd1c9 100644 --- a/src/media/playback/mediaplayer/graph/payloads/vmo_payload_allocator.cc +++ b/src/media/playback/mediaplayer/graph/payloads/vmo_payload_allocator.cc @@ -86,7 +86,7 @@ void VmoPayloadAllocator::AddVmo(fbl::RefPtr<PayloadVmo> payload_vmo) { payload_vmos_.push_back(payload_vmo); if (vmo_allocation_ != VmoAllocation::kVmoPerBuffer) { payload_vmo->allocator_ = - fbl::make_unique<FifoAllocator>(payload_vmo->size()); + std::make_unique<FifoAllocator>(payload_vmo->size()); } } diff --git a/zircon/system/core/bootsvc/main.cpp b/zircon/system/core/bootsvc/main.cpp index 1029e27188f..9a976592692 100644 --- a/zircon/system/core/bootsvc/main.cpp +++ b/zircon/system/core/bootsvc/main.cpp @@ -170,7 +170,7 @@ int LaunchNextProcess(void* raw_ctx) { void StartLaunchNextProcessThread(const fbl::RefPtr<bootsvc::BootfsService>& bootfs, const fbl::RefPtr<bootsvc::SvcfsService>& svcfs) { - auto args = fbl::make_unique<LaunchNextProcessArgs>(); + auto args = std::make_unique<LaunchNextProcessArgs>(); args->bootfs = bootfs; args->svcfs = svcfs; diff --git a/zircon/system/core/bootsvc/util.cpp b/zircon/system/core/bootsvc/util.cpp index 36fe0442f6c..e3d4a750651 100644 --- a/zircon/system/core/bootsvc/util.cpp +++ b/zircon/system/core/bootsvc/util.cpp @@ -164,7 +164,7 @@ zx_status_t CreateVnodeConnection(fs::Vfs* vfs, fbl::RefPtr<fs::Vnode> vnode, zx return status; } - auto conn = fbl::make_unique<fs::Connection>(vfs, vnode, std::move(local), + auto conn = std::make_unique<fs::Connection>(vfs, vnode, std::move(local), ZX_FS_FLAG_DIRECTORY | ZX_FS_RIGHT_READABLE | ZX_FS_RIGHT_WRITABLE); diff --git a/zircon/system/core/devmgr/devcoordinator/coordinator.cpp b/zircon/system/core/devmgr/devcoordinator/coordinator.cpp index c60f4dbd818..c9202eeef0c 100644 --- a/zircon/system/core/devmgr/devcoordinator/coordinator.cpp +++ b/zircon/system/core/devmgr/devcoordinator/coordinator.cpp @@ -568,7 +568,7 @@ static zx_status_t dc_launch_devhost(Devhost* host, DevhostLoaderService* loader } zx_status_t Coordinator::NewDevhost(const char* name, Devhost* parent, Devhost** out) { - auto dh = fbl::make_unique<Devhost>(); + auto dh = std::make_unique<Devhost>(); if (dh == nullptr) { return ZX_ERR_NO_MEMORY; } diff --git a/zircon/system/core/devmgr/devcoordinator/devfs.cpp b/zircon/system/core/devmgr/devcoordinator/devfs.cpp index 832970f835d..c7270bb9546 100644 --- a/zircon/system/core/devmgr/devcoordinator/devfs.cpp +++ b/zircon/system/core/devmgr/devcoordinator/devfs.cpp @@ -268,7 +268,7 @@ void devfs_notify(Devnode* dn, const fbl::String& name, unsigned op) { } // namespace zx_status_t devfs_watch(Devnode* dn, zx::channel h, uint32_t mask) { - auto watcher = fbl::make_unique<Watcher>(dn, std::move(h), mask); + auto watcher = std::make_unique<Watcher>(dn, std::move(h), mask); if (watcher == nullptr) { return ZX_ERR_NO_MEMORY; } @@ -297,7 +297,7 @@ zx_status_t devfs_watch(Devnode* dn, zx::channel h, uint32_t mask) { namespace { fbl::unique_ptr<Devnode> devfs_mknode(const fbl::RefPtr<Device>& dev, const fbl::String& name) { - auto dn = fbl::make_unique<Devnode>(name); + auto dn = std::make_unique<Devnode>(name); if (!dn) { return nullptr; } @@ -555,7 +555,7 @@ void DcIostate::DetachFromDevnode() { } zx_status_t DcIostate::Create(Devnode* dn, async_dispatcher_t* dispatcher, zx::channel* ipc) { - auto ios = fbl::make_unique<DcIostate>(dn); + auto ios = std::make_unique<DcIostate>(dn); if (ios == nullptr) { return ZX_ERR_NO_MEMORY; } @@ -850,7 +850,7 @@ zx::channel devfs_root_clone() { } void devfs_init(const fbl::RefPtr<Device>& device, async_dispatcher_t* dispatcher) { - root_devnode = fbl::make_unique<Devnode>(""); + root_devnode = std::make_unique<Devnode>(""); if (!root_devnode) { printf("devcoordinator: failed to allocate devfs root node\n"); return; diff --git a/zircon/system/core/devmgr/devcoordinator/driver.cpp b/zircon/system/core/devmgr/devcoordinator/driver.cpp index aef0ad6ddf5..41e5e5e8d33 100644 --- a/zircon/system/core/devmgr/devcoordinator/driver.cpp +++ b/zircon/system/core/devmgr/devcoordinator/driver.cpp @@ -45,12 +45,12 @@ void found_driver(zircon_driver_note_payload_t* note, const zx_bind_inst_t* bi, return; } - auto drv = fbl::make_unique<devmgr::Driver>(); + auto drv = std::make_unique<devmgr::Driver>(); if (drv == nullptr) { return; } - auto binding = fbl::make_unique<zx_bind_inst_t[]>(note->bindcount); + auto binding = std::make_unique<zx_bind_inst_t[]>(note->bindcount); if (binding == nullptr) { return; } diff --git a/zircon/system/core/devmgr/devcoordinator/fidl-proxy.cpp b/zircon/system/core/devmgr/devcoordinator/fidl-proxy.cpp index 249fc89bb44..bfb711b6ee0 100644 --- a/zircon/system/core/devmgr/devcoordinator/fidl-proxy.cpp +++ b/zircon/system/core/devmgr/devcoordinator/fidl-proxy.cpp @@ -10,7 +10,7 @@ namespace devmgr { zx_status_t FidlProxyHandler::Create(Coordinator* coordinator, async_dispatcher_t* dispatcher, zx::channel proxy_channel) { - auto handler = fbl::make_unique<FidlProxyHandler>(coordinator); + auto handler = std::make_unique<FidlProxyHandler>(coordinator); if (handler == nullptr) { return ZX_ERR_NO_MEMORY; } diff --git a/zircon/system/core/devmgr/devhost/devhost.cpp b/zircon/system/core/devmgr/devhost/devhost.cpp index fbdca3e55a2..7b6fe1a8490 100644 --- a/zircon/system/core/devmgr/devhost/devhost.cpp +++ b/zircon/system/core/devmgr/devhost/devhost.cpp @@ -88,7 +88,7 @@ async::Loop* DevhostAsyncLoop() { } static zx_status_t SetupRootDevcoordinatorConnection(zx::channel ch) { - auto conn = fbl::make_unique<DevhostControllerConnection>(); + auto conn = std::make_unique<DevhostControllerConnection>(); if (conn == nullptr) { return ZX_ERR_NO_MEMORY; } @@ -367,7 +367,7 @@ static zx_status_t fidl_CreateDeviceStub(void* raw_ctx, zx_handle_t raw_rpc, uin zx::channel rpc(raw_rpc); log(RPC_IN, "devhost: create device stub\n"); - auto newconn = fbl::make_unique<DeviceControllerConnection>(); + auto newconn = std::make_unique<DeviceControllerConnection>(); if (!newconn) { return ZX_ERR_NO_MEMORY; } @@ -413,7 +413,7 @@ static zx_status_t fidl_CreateDevice(void* raw_ctx, zx_handle_t raw_rpc, static_cast<int>(driver_path_size), driver_path_data, static_cast<int>(proxy_args_size), proxy_args_data); - auto newconn = fbl::make_unique<DeviceControllerConnection>(); + auto newconn = std::make_unique<DeviceControllerConnection>(); if (!newconn) { return ZX_ERR_NO_MEMORY; } @@ -490,7 +490,7 @@ static zx_status_t fidl_CreateCompositeDevice(void* raw_ctx, zx_handle_t raw_rpc log(RPC_IN, "devhost: create composite device %.*s'\n", static_cast<int>(name_size), name_data); - auto newconn = fbl::make_unique<DeviceControllerConnection>(); + auto newconn = std::make_unique<DeviceControllerConnection>(); if (!newconn) { return fuchsia_device_manager_DevhostControllerCreateCompositeDevice_reply(txn, ZX_ERR_NO_MEMORY); @@ -872,7 +872,7 @@ zx_status_t ProxyIostate::Create(const fbl::RefPtr<zx_device_t>& dev, zx::channe dev->proxy_ios = nullptr; } - auto ios = fbl::make_unique<ProxyIostate>(); + auto ios = std::make_unique<ProxyIostate>(); if (ios == nullptr) { return ZX_ERR_NO_MEMORY; } @@ -925,7 +925,7 @@ static ssize_t devhost_log_write_internal(uint32_t flags, const void* void_data, static thread_local fbl::unique_ptr<Context> ctx; if (ctx == nullptr) { - ctx = fbl::make_unique<Context>(); + ctx = std::make_unique<Context>(); if (ctx == nullptr) { return len; } @@ -1024,7 +1024,7 @@ zx_status_t devhost_add(const fbl::RefPtr<zx_device_t>& parent, bool add_invisible = child->flags & DEV_FLAG_INVISIBLE; - auto conn = fbl::make_unique<DeviceControllerConnection>(); + auto conn = std::make_unique<DeviceControllerConnection>(); if (!conn) { return ZX_ERR_NO_MEMORY; } diff --git a/zircon/system/core/devmgr/devhost/devhost.h b/zircon/system/core/devmgr/devhost/devhost.h index ccc5cedc117..d4d14edc447 100644 --- a/zircon/system/core/devmgr/devhost/devhost.h +++ b/zircon/system/core/devmgr/devhost/devhost.h @@ -107,7 +107,7 @@ struct zx_driver : fbl::DoublyLinkedListable<fbl::RefPtr<zx_driver>>, fbl::RefCo } private: - friend fbl::unique_ptr<zx_driver> fbl::make_unique<zx_driver>(); + friend fbl::unique_ptr<zx_driver> std::make_unique<zx_driver>(); zx_driver() = default; const char* name_ = nullptr; diff --git a/zircon/system/core/devmgr/devhost/rpc-server.cpp b/zircon/system/core/devmgr/devhost/rpc-server.cpp index 6829ad4dce1..99e3f86eb2d 100644 --- a/zircon/system/core/devmgr/devhost/rpc-server.cpp +++ b/zircon/system/core/devmgr/devhost/rpc-server.cpp @@ -97,7 +97,7 @@ static zx_status_t devhost_get_handles(zx::channel rh, const fbl::RefPtr<zx_devi bool describe = flags & ZX_FS_FLAG_DESCRIBE; flags &= (~ZX_FS_FLAG_DESCRIBE); - auto newconn = fbl::make_unique<DevfsConnection>(); + auto newconn = std::make_unique<DevfsConnection>(); if (!newconn) { r = ZX_ERR_NO_MEMORY; if (describe) { diff --git a/zircon/system/core/devmgr/dmctl/dmctl.cpp b/zircon/system/core/devmgr/dmctl/dmctl.cpp index ae1b5527359..3172c53d6ef 100644 --- a/zircon/system/core/devmgr/dmctl/dmctl.cpp +++ b/zircon/system/core/devmgr/dmctl/dmctl.cpp @@ -34,7 +34,7 @@ public: Dmctl::Dmctl(zx_device_t* parent) : DmctlBase(parent) {} zx_status_t Dmctl::Bind(void* ctx, zx_device_t* parent) { - auto dev = fbl::make_unique<Dmctl>(parent); + auto dev = std::make_unique<Dmctl>(parent); auto status = dev->DdkAdd("dmctl"); if (status == ZX_OK) { // devmgr owns the memory now diff --git a/zircon/system/core/devmgr/fshost/main.cpp b/zircon/system/core/devmgr/fshost/main.cpp index 98ab8419d02..df3dcd3db84 100644 --- a/zircon/system/core/devmgr/fshost/main.cpp +++ b/zircon/system/core/devmgr/fshost/main.cpp @@ -206,7 +206,7 @@ int main(int argc, char** argv) { zx::event fshost_event(zx_take_startup_handle(PA_HND(PA_USER1, 0))); // First, initialize the local filesystem in isolation. - auto root = fbl::make_unique<devmgr::FsManager>(); + auto root = std::make_unique<devmgr::FsManager>(); // Initialize connections to external service managers, and begin // monitoring the |fshost_event| for a termination event. diff --git a/zircon/system/core/devmgr/fshost/vfs-rpc.cpp b/zircon/system/core/devmgr/fshost/vfs-rpc.cpp index 6ec373bfbc0..0356f733ab5 100644 --- a/zircon/system/core/devmgr/fshost/vfs-rpc.cpp +++ b/zircon/system/core/devmgr/fshost/vfs-rpc.cpp @@ -138,7 +138,7 @@ zx_status_t FsManager::InitializeConnections(zx::channel root, zx::channel devfs printf("fshost: cannot create global root: %d\n", status); } - connections_ = fbl::make_unique<FshostConnections>(std::move(devfs_root), std::move(svc_root), + connections_ = std::make_unique<FshostConnections>(std::move(devfs_root), std::move(svc_root), std::move(fs_root), std::move(fshost_event)); // Now that we've initialized our connection to the outside world, // monitor for external shutdown events. diff --git a/zircon/system/dev/block/aml-sd-emmc/aml-sd-emmc.cpp b/zircon/system/dev/block/aml-sd-emmc/aml-sd-emmc.cpp index bd0baa43719..35e80ad14e8 100644 --- a/zircon/system/dev/block/aml-sd-emmc/aml-sd-emmc.cpp +++ b/zircon/system/dev/block/aml-sd-emmc/aml-sd-emmc.cpp @@ -995,7 +995,7 @@ zx_status_t AmlSdEmmc::Create(void* ctx, zx_device_t* parent) { } } - auto dev = fbl::make_unique<AmlSdEmmc>(parent, pdev, std::move(bti), *std::move(mmio), + auto dev = std::make_unique<AmlSdEmmc>(parent, pdev, std::move(bti), *std::move(mmio), *std::move(pinned_mmio), config, std::move(irq), reset_gpio); diff --git a/zircon/system/dev/block/fvm/fvm.cpp b/zircon/system/dev/block/fvm/fvm.cpp index 07c51aad047..f2ca04af78a 100644 --- a/zircon/system/dev/block/fvm/fvm.cpp +++ b/zircon/system/dev/block/fvm/fvm.cpp @@ -57,7 +57,7 @@ zx_status_t VPartitionManager::Bind(zx_device_t* dev) { } bp.ops->query(bp.ctx, &block_info, &block_op_size); - auto vpm = fbl::make_unique<VPartitionManager>(dev, block_info, block_op_size, &bp); + auto vpm = std::make_unique<VPartitionManager>(dev, block_info, block_op_size, &bp); zx_status_t status = vpm->DdkAdd("fvm", DEVICE_ADD_INVISIBLE); if (status != ZX_OK) { diff --git a/zircon/system/dev/block/fvm/vpartition.cpp b/zircon/system/dev/block/fvm/vpartition.cpp index a1b7708e1fa..a17d8f29218 100644 --- a/zircon/system/dev/block/fvm/vpartition.cpp +++ b/zircon/system/dev/block/fvm/vpartition.cpp @@ -29,7 +29,7 @@ zx_status_t VPartition::Create(VPartitionManager* vpm, size_t entry_index, fbl::unique_ptr<VPartition>* out) { ZX_DEBUG_ASSERT(entry_index != 0); - auto vp = fbl::make_unique<VPartition>(vpm, entry_index, vpm->BlockOpSize()); + auto vp = std::make_unique<VPartition>(vpm, entry_index, vpm->BlockOpSize()); *out = std::move(vp); return ZX_OK; diff --git a/zircon/system/dev/bus/pci/allocation.cpp b/zircon/system/dev/bus/pci/allocation.cpp index d4dcb421000..676cf17eeeb 100644 --- a/zircon/system/dev/bus/pci/allocation.cpp +++ b/zircon/system/dev/bus/pci/allocation.cpp @@ -26,7 +26,7 @@ zx_status_t PciAllocation::CreateVmObject(fbl::unique_ptr<zx::vmo>* out_vmo) con return status; } - *out_vmo = fbl::make_unique<zx::vmo>(std::move(temp)); + *out_vmo = std::make_unique<zx::vmo>(std::move(temp)); return status; } diff --git a/zircon/system/dev/bus/virtio/scsi_test.cpp b/zircon/system/dev/bus/virtio/scsi_test.cpp index f2daa26ccec..7e0737a1f96 100644 --- a/zircon/system/dev/bus/virtio/scsi_test.cpp +++ b/zircon/system/dev/bus/virtio/scsi_test.cpp @@ -33,7 +33,7 @@ class FakeBackendForScsi : public virtio::FakeBackend { bool InitTest() { BEGIN_TEST; - fbl::unique_ptr<virtio::Backend> backend = fbl::make_unique<FakeBackendForScsi>(); + fbl::unique_ptr<virtio::Backend> backend = std::make_unique<FakeBackendForScsi>(); zx::bti bti(ZX_HANDLE_INVALID); virtio::ScsiDevice scsi(/*parent=*/nullptr, std::move(bti), std::move(backend)); diff --git a/zircon/system/dev/clk/amlogic-clk/aml-clk.cpp b/zircon/system/dev/clk/amlogic-clk/aml-clk.cpp index 120c89dcd93..01d494d5dd0 100644 --- a/zircon/system/dev/clk/amlogic-clk/aml-clk.cpp +++ b/zircon/system/dev/clk/amlogic-clk/aml-clk.cpp @@ -170,7 +170,7 @@ zx_status_t AmlClock::InitPdev(zx_device_t* parent) { } zx_status_t AmlClock::Create(zx_device_t* parent) { - auto clock_device = fbl::make_unique<amlogic_clock::AmlClock>(parent); + auto clock_device = std::make_unique<amlogic_clock::AmlClock>(parent); zx_status_t status = clock_device->InitPdev(parent); if (status != ZX_OK) { diff --git a/zircon/system/dev/ethernet/dwmac/dwmac.cpp b/zircon/system/dev/ethernet/dwmac/dwmac.cpp index 79c8afbbe4b..eefde921fb2 100644 --- a/zircon/system/dev/ethernet/dwmac/dwmac.cpp +++ b/zircon/system/dev/ethernet/dwmac/dwmac.cpp @@ -192,7 +192,7 @@ zx_status_t DWMacDevice::Create(void* ctx, zx_device_t* device) { return status; } - auto mac_device = fbl::make_unique<DWMacDevice>(device, &pdev, ð_board); + auto mac_device = std::make_unique<DWMacDevice>(device, &pdev, ð_board); status = mac_device->InitPdev(); if (status != ZX_OK) { diff --git a/zircon/system/dev/input/focaltech/ft_device.cpp b/zircon/system/dev/input/focaltech/ft_device.cpp index 97e9a0e20ac..5c0fff64cae 100644 --- a/zircon/system/dev/input/focaltech/ft_device.cpp +++ b/zircon/system/dev/input/focaltech/ft_device.cpp @@ -126,7 +126,7 @@ zx_status_t FtDevice::Create(zx_device_t* device) { zxlogf(INFO, "focaltouch: driver started...\n"); - auto ft_dev = fbl::make_unique<FtDevice>(device); + auto ft_dev = std::make_unique<FtDevice>(device); zx_status_t status = ft_dev->InitPdev(); if (status != ZX_OK) { zxlogf(ERROR, "focaltouch: Driver bind failed %d\n", status); diff --git a/zircon/system/dev/input/goodix/gt92xx.cpp b/zircon/system/dev/input/goodix/gt92xx.cpp index d525f1021f7..b828be4d944 100644 --- a/zircon/system/dev/input/goodix/gt92xx.cpp +++ b/zircon/system/dev/input/goodix/gt92xx.cpp @@ -112,7 +112,7 @@ zx_status_t Gt92xxDevice::Create(zx_device_t* device) { zxlogf(ERROR, "%s failed to allocate gpio or i2c\n", __func__); return ZX_ERR_NO_RESOURCES; } - auto goodix_dev = fbl::make_unique<Gt92xxDevice>(device, + auto goodix_dev = std::make_unique<Gt92xxDevice>(device, std::move(i2c), std::move(intr), std::move(reset)); diff --git a/zircon/system/dev/light-sensor/ams-light/tcs3400.cpp b/zircon/system/dev/light-sensor/ams-light/tcs3400.cpp index 6faf0908e9c..054b3c45805 100644 --- a/zircon/system/dev/light-sensor/ams-light/tcs3400.cpp +++ b/zircon/system/dev/light-sensor/ams-light/tcs3400.cpp @@ -426,7 +426,7 @@ void Tcs3400Device::DdkRelease() { } // namespace tcs extern "C" zx_status_t tcs3400_bind(void* ctx, zx_device_t* parent) { - auto dev = fbl::make_unique<tcs::Tcs3400Device>(parent); + auto dev = std::make_unique<tcs::Tcs3400Device>(parent); auto status = dev->Bind(); if (status == ZX_OK) { // devmgr is now in charge of the memory for dev diff --git a/zircon/system/dev/misc/test/test.cpp b/zircon/system/dev/misc/test/test.cpp index 994459fa838..4e5bc44f11a 100644 --- a/zircon/system/dev/misc/test/test.cpp +++ b/zircon/system/dev/misc/test/test.cpp @@ -167,7 +167,7 @@ zx_status_t TestRootDevice::CreateDevice(const fbl::StringPiece& name, return ZX_ERR_BUFFER_TOO_SMALL; } - auto device = fbl::make_unique<TestDevice>(zxdev()); + auto device = std::make_unique<TestDevice>(zxdev()); zx_status_t status = device->DdkAdd(devname); if (status != ZX_OK) { return status; @@ -199,7 +199,7 @@ zx_status_t TestRootDevice::DdkMessage(fidl_msg_t* msg, fidl_txn_t* txn) { } zx_status_t TestDriverBind(void* ctx, zx_device_t* dev) { - auto root = fbl::make_unique<TestRootDevice>(dev); + auto root = std::make_unique<TestRootDevice>(dev); zx_status_t status = root->Bind(); if (status != ZX_OK) { return status; diff --git a/zircon/system/dev/nand/nandpart/test/aml-bad-block-test.cpp b/zircon/system/dev/nand/nandpart/test/aml-bad-block-test.cpp index f73cf51ed24..23dc6db6e45 100644 --- a/zircon/system/dev/nand/nandpart/test/aml-bad-block-test.cpp +++ b/zircon/system/dev/nand/nandpart/test/aml-bad-block-test.cpp @@ -176,7 +176,7 @@ void MockQueue(void* ctx, nand_operation_t* op, nand_queue_callback completion_c bad_blocks.push_back(block); } } - auto node = fbl::make_unique<TableNode>(op->rw.offset_nand + i, std::move(bad_blocks), + auto node = std::make_unique<TableNode>(op->rw.offset_nand + i, std::move(bad_blocks), true, oob->generation); if (!context->table_entries.insert_or_find(std::move(node))) { unittest_printf("Trying to write to a page that isn't erased!\n"); @@ -218,8 +218,8 @@ bool GetBadBlockListTest() { BEGIN_TEST; TableNode::ResetCount(); TableEntries table_entries; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(0)); - table_entries.insert_or_replace(fbl::make_unique<TableNode>(1)); + table_entries.insert_or_replace(std::make_unique<TableNode>(0)); + table_entries.insert_or_replace(std::make_unique<TableNode>(1)); Context context = { .table_entries = table_entries, }; @@ -240,9 +240,9 @@ bool GetBadBlockListWithEntriesTest() { BEGIN_TEST; TableNode::ResetCount(); TableEntries table_entries; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(0)); + table_entries.insert_or_replace(std::make_unique<TableNode>(0)); fbl::Vector<uint32_t> bad_blocks_v = {4, 8}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(1, std::move(bad_blocks_v))); + table_entries.insert_or_replace(std::make_unique<TableNode>(1, std::move(bad_blocks_v))); Context context = { .table_entries = table_entries, }; @@ -276,12 +276,12 @@ bool FindBadBlockSecondBlockTest() { TableNode::ResetCount(); TableEntries table_entries; fbl::Vector<uint32_t> bad_blocks_1 = {4, 6}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(0, std::move(bad_blocks_1))); + table_entries.insert_or_replace(std::make_unique<TableNode>(0, std::move(bad_blocks_1))); fbl::Vector<uint32_t> bad_blocks_2 = {4, 6, 8}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 3, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 3, std::move(bad_blocks_2))); fbl::Vector<uint32_t> bad_blocks_3 = {4, 6, 8, 9}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock, std::move(bad_blocks_3))); Context context = { .table_entries = table_entries, @@ -304,13 +304,13 @@ bool FindBadBlockLastBlockTest() { TableNode::ResetCount(); TableEntries table_entries; fbl::Vector<uint32_t> bad_blocks_1 = {4, 6}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 2, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 2, std::move(bad_blocks_1))); fbl::Vector<uint32_t> bad_blocks_2 = {4, 6, 8}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock, std::move(bad_blocks_2))); fbl::Vector<uint32_t> bad_blocks_3 = {4, 6, 8, 9}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 3, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 3, std::move(bad_blocks_3))); Context context = { .table_entries = table_entries, @@ -332,8 +332,8 @@ bool MarkBlockBadTest() { BEGIN_TEST; TableNode::ResetCount(); TableEntries table_entries; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(0)); - table_entries.insert_or_replace(fbl::make_unique<TableNode>(1)); + table_entries.insert_or_replace(std::make_unique<TableNode>(0)); + table_entries.insert_or_replace(std::make_unique<TableNode>(1)); Context context = { .table_entries = table_entries, }; @@ -363,13 +363,13 @@ bool FindBadBlockLastPageInvalidTest() { TableNode::ResetCount(); TableEntries table_entries; fbl::Vector<uint32_t> bad_blocks_1 = {4, 6}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 2, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 2, std::move(bad_blocks_1))); fbl::Vector<uint32_t> bad_blocks_2 = {4, 6, 8}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 3, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 3, std::move(bad_blocks_2))); fbl::Vector<uint32_t> bad_blocks_3 = {4, 6, 8, 9}; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 3 + 1, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 3 + 1, std::move(bad_blocks_3), false)); Context context = { .table_entries = table_entries, @@ -399,10 +399,10 @@ bool FindBadBlockNoValidTest() { TableEntries table_entries; for (uint32_t block = 0; block < 4; block++) { for (uint32_t page = 0; page < 6; page++) { - table_entries.insert_or_replace(fbl::make_unique<TableNode>( + table_entries.insert_or_replace(std::make_unique<TableNode>( kPagesPerBlock * block + page, false)); } - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * block + 6)); + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * block + 6)); } Context context = { .table_entries = table_entries, @@ -422,11 +422,11 @@ bool FindBadBlockBigHoleTest() { BEGIN_TEST; TableNode::ResetCount(); TableEntries table_entries; - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 3)); + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 3)); for (uint32_t i = 1; i < 9; i++) { - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 3 + i, false)); + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 3 + i, false)); } - table_entries.insert_or_replace(fbl::make_unique<TableNode>(kPagesPerBlock * 3 + 9, + table_entries.insert_or_replace(std::make_unique<TableNode>(kPagesPerBlock * 3 + 9, fbl::Vector<uint32_t>({4}))); Context context = { @@ -450,7 +450,7 @@ bool MarkBlockBadFullBlockTest() { TableNode::ResetCount(); TableEntries table_entries; for (uint32_t i = 0; i < kPagesPerBlock; i++) { - table_entries.insert_or_replace(fbl::make_unique<TableNode>(i)); + table_entries.insert_or_replace(std::make_unique<TableNode>(i)); } Context context = { .table_entries = table_entries, diff --git a/zircon/system/dev/pci/amlogic-pcie/aml-pcie-device.cpp b/zircon/system/dev/pci/amlogic-pcie/aml-pcie-device.cpp index ae5014593c2..53cdf9d7566 100644 --- a/zircon/system/dev/pci/amlogic-pcie/aml-pcie-device.cpp +++ b/zircon/system/dev/pci/amlogic-pcie/aml-pcie-device.cpp @@ -183,7 +183,7 @@ zx_status_t AmlPcieDevice::Init() { st = InitMetadata(); if (st != ZX_OK) return st; - pcie_ = fbl::make_unique<AmlPcie>( + pcie_ = std::make_unique<AmlPcie>( *std::move(dbi_), *std::move(cfg_), *std::move(rst_), diff --git a/zircon/system/dev/power/msm8x53-power/msm8x53-power.cpp b/zircon/system/dev/power/msm8x53-power/msm8x53-power.cpp index 5c7b21d08a2..10b4458dc4d 100644 --- a/zircon/system/dev/power/msm8x53-power/msm8x53-power.cpp +++ b/zircon/system/dev/power/msm8x53-power/msm8x53-power.cpp @@ -203,7 +203,7 @@ zx_status_t Msm8x53Power::Create(void* ctx, zx_device_t* parent) { return status; } - auto dev = fbl::make_unique<Msm8x53Power>(parent, pdev, *std::move(core_mmio), + auto dev = std::make_unique<Msm8x53Power>(parent, pdev, *std::move(core_mmio), *std::move(chnls_mmio), *std::move(obsvr_mmio), *std::move(intr_mmio), diff --git a/zircon/system/dev/power/mtk-power/mtk-power.cpp b/zircon/system/dev/power/mtk-power/mtk-power.cpp index 1c34da63cba..6a3ed65065a 100644 --- a/zircon/system/dev/power/mtk-power/mtk-power.cpp +++ b/zircon/system/dev/power/mtk-power/mtk-power.cpp @@ -219,7 +219,7 @@ zx_status_t MtkPower::Create(void* ctx, zx_device_t* parent) { zxlogf(ERROR, "%s Failed to get mmio: %d\n", __FUNCTION__, status); return status; } - auto dev = fbl::make_unique<MtkPower>(parent, pdev, *std::move(mmio)); + auto dev = std::make_unique<MtkPower>(parent, pdev, *std::move(mmio)); if ((status = dev->Init()) != ZX_OK) { return status; diff --git a/zircon/system/dev/rtc/fallback/rtc-impl.cpp b/zircon/system/dev/rtc/fallback/rtc-impl.cpp index 48e9fca908f..b6b0b327084 100644 --- a/zircon/system/dev/rtc/fallback/rtc-impl.cpp +++ b/zircon/system/dev/rtc/fallback/rtc-impl.cpp @@ -110,7 +110,7 @@ zx_status_t fidl_Set(void* ctx, const fuchsia_hardware_rtc_Time* rtc, fidl_txn_t } // namespace extern "C" zx_status_t fallback_rtc_bind(void* ctx, zx_device_t* parent) { - auto dev = fbl::make_unique<FallbackRtc>(parent); + auto dev = std::make_unique<FallbackRtc>(parent); auto status = dev->Bind(); if (status == ZX_OK) { // devmgr is now in charge of the device, until DdkRelease(). diff --git a/zircon/system/dev/sysmem/sysmem/amlogic_memory_allocator.cpp b/zircon/system/dev/sysmem/sysmem/amlogic_memory_allocator.cpp index b554734bb30..c494c32b7e2 100644 --- a/zircon/system/dev/sysmem/sysmem/amlogic_memory_allocator.cpp +++ b/zircon/system/dev/sysmem/sysmem/amlogic_memory_allocator.cpp @@ -56,7 +56,7 @@ zx_status_t AmlogicMemoryAllocator::Allocate(size_t size, zx::vmo* vmo) { } } - auto region = fbl::make_unique<Region>(); + auto region = std::make_unique<Region>(); zx_status_t status = protected_allocator_.GetRegion(size, ZX_PAGE_SIZE, region->region); if (status != ZX_OK) { diff --git a/zircon/system/dev/sysmem/sysmem/device.cpp b/zircon/system/dev/sysmem/sysmem/device.cpp index 26a94b7ffa1..11b12624048 100644 --- a/zircon/system/dev/sysmem/sysmem/device.cpp +++ b/zircon/system/dev/sysmem/sysmem/device.cpp @@ -106,7 +106,7 @@ zx_status_t Device::Bind() { // TODO: Separate protected memory allocator into separate driver or library if (pdev_device_info_vid_ == PDEV_VID_AMLOGIC && protected_memory_size > 0) { - auto amlogic_allocator = fbl::make_unique<AmlogicMemoryAllocator>(std::move(bti_copy)); + auto amlogic_allocator = std::make_unique<AmlogicMemoryAllocator>(std::move(bti_copy)); status = amlogic_allocator->Init(protected_memory_size); if (status != ZX_OK) { DRIVER_ERROR("Failed to init allocator for amlogic protected memory: %d", status); diff --git a/zircon/system/dev/tee/optee/optee-client.cpp b/zircon/system/dev/tee/optee/optee-client.cpp index 08e20e3ec62..53758422e59 100644 --- a/zircon/system/dev/tee/optee/optee-client.cpp +++ b/zircon/system/dev/tee/optee/optee-client.cpp @@ -222,7 +222,7 @@ zx_status_t OpteeClient::OpenSession(const fuchsia_tee_Uuid* trusted_app, return fuchsia_tee_DeviceOpenSession_reply(txn, kInvalidSession, &result); } - open_sessions_.insert(fbl::make_unique<OpteeSession>(message.session_id())); + open_sessions_.insert(std::make_unique<OpteeSession>(message.session_id())); return fuchsia_tee_DeviceOpenSession_reply(txn, message.session_id(), &result); } diff --git a/zircon/system/dev/tee/optee/optee-controller.cpp b/zircon/system/dev/tee/optee/optee-controller.cpp index 316e850cda1..90da423dc2e 100644 --- a/zircon/system/dev/tee/optee/optee-controller.cpp +++ b/zircon/system/dev/tee/optee/optee-controller.cpp @@ -287,7 +287,7 @@ zx_status_t OpteeController::ConnectDevice(zx_handle_t service_provider, ZX_DEBUG_ASSERT(device_request_channel.is_valid()); // Create a new OpteeClient device and hand off client communication to it. - auto client = fbl::make_unique<OpteeClient>(this, std::move(service_provider_channel)); + auto client = std::make_unique<OpteeClient>(this, std::move(service_provider_channel)); // Add child client device and have it immediately start serving device_request // diff --git a/zircon/system/dev/test/mock-device/device.cpp b/zircon/system/dev/test/mock-device/device.cpp index c500ab0324b..7f3e5e53c47 100644 --- a/zircon/system/dev/test/mock-device/device.cpp +++ b/zircon/system/dev/test/mock-device/device.cpp @@ -142,7 +142,7 @@ int MockDevice::ThreadFunc(void* raw_arg) { } void MockDevice::CreateThread(zx::channel channel) { - auto arg = fbl::make_unique<ThreadFuncArg>(); + auto arg = std::make_unique<ThreadFuncArg>(); arg->channel = std::move(channel); arg->dev = this; @@ -353,7 +353,7 @@ zx_status_t MockDevice::DdkRxrpc(zx_handle_t channel) { zx_status_t MockDevice::Create(zx_device_t* parent, zx::channel controller, fbl::unique_ptr<MockDevice>* out) { - auto dev = fbl::make_unique<MockDevice>(parent, std::move(controller)); + auto dev = std::make_unique<MockDevice>(parent, std::move(controller)); *out = std::move(dev); return ZX_OK; } diff --git a/zircon/system/dev/test/mock-device/fidl.cpp b/zircon/system/dev/test/mock-device/fidl.cpp index 033087d0aa2..a0a81fa9f46 100644 --- a/zircon/system/dev/test/mock-device/fidl.cpp +++ b/zircon/system/dev/test/mock-device/fidl.cpp @@ -26,7 +26,7 @@ zx_status_t ParseActions(const fidl_type_t* type, fidl::Message* msg, return status; } auto payload = msg->GetBytesAs<MessageType>(); - auto array = fbl::make_unique<fuchsia_device_mock_Action[]>(payload->actions.count); + auto array = std::make_unique<fuchsia_device_mock_Action[]>(payload->actions.count); memcpy(array.get(), payload->actions.data, payload->actions.count * sizeof(fuchsia_device_mock_Action)); actions_out->reset(array.release(), payload->actions.count); diff --git a/zircon/system/dev/test/sysdev/sysdev.cpp b/zircon/system/dev/test/sysdev/sysdev.cpp index 7b7c5a0f41f..96e0279084a 100644 --- a/zircon/system/dev/test/sysdev/sysdev.cpp +++ b/zircon/system/dev/test/sysdev/sysdev.cpp @@ -31,7 +31,7 @@ public: }; zx_status_t Sysdev::Create(zx_device_t* parent, const char* name, zx::channel items_svc) { - auto sysdev = fbl::make_unique<Sysdev>(parent); + auto sysdev = std::make_unique<Sysdev>(parent); zx_status_t status = sysdev->DdkAdd("sys", DEVICE_ADD_NON_BINDABLE, nullptr /* props */, 0 /* prop_count */); diff --git a/zircon/system/dev/thermal/aml-thermal-s912/aml-thermal.cpp b/zircon/system/dev/thermal/aml-thermal-s912/aml-thermal.cpp index d6a1a5a2611..83e9d8cafc9 100644 --- a/zircon/system/dev/thermal/aml-thermal-s912/aml-thermal.cpp +++ b/zircon/system/dev/thermal/aml-thermal-s912/aml-thermal.cpp @@ -85,7 +85,7 @@ zx_status_t AmlThermal::Create(void* ctx, zx_device_t* device) { return status; } - auto thermal = fbl::make_unique<AmlThermal>(device, fan0_gpio_proto, fan1_gpio_proto, + auto thermal = std::make_unique<AmlThermal>(device, fan0_gpio_proto, fan1_gpio_proto, scpi_proto, sensor_id, port); status = thermal->DdkAdd("vim-thermal", DEVICE_ADD_INVISIBLE); diff --git a/zircon/system/host/fvm/mtd.cpp b/zircon/system/host/fvm/mtd.cpp index de4211ad43a..112fc276069 100644 --- a/zircon/system/host/fvm/mtd.cpp +++ b/zircon/system/host/fvm/mtd.cpp @@ -44,7 +44,7 @@ zx_status_t CreateFileWrapperFromMtd(const char* path, uint32_t offset, uint32_t return ZX_ERR_BAD_STATE; } - auto ftl_wrapper = fbl::make_unique<ftl_mtd::FtlVolumeWrapper>(); + auto ftl_wrapper = std::make_unique<ftl_mtd::FtlVolumeWrapper>(); status = ftl_wrapper->Init(std::move(driver)); if (status != ZX_OK) { diff --git a/zircon/system/ulib/async-testutils/test_loop.cpp b/zircon/system/ulib/async-testutils/test_loop.cpp index f4a46a5c2ac..ddb87b41e1e 100644 --- a/zircon/system/ulib/async-testutils/test_loop.cpp +++ b/zircon/system/ulib/async-testutils/test_loop.cpp @@ -93,7 +93,7 @@ TestLoop::TestLoop() : TestLoop(0) {} TestLoop::TestLoop(uint32_t state) : time_keeper_(new TestLoopTimeKeeper()), initial_state_((state != 0)? state : GetRandomSeed()), state_(initial_state_) { - dispatchers_.push_back(fbl::make_unique<TestLoopDispatcher>(time_keeper_.get())); + dispatchers_.push_back(std::make_unique<TestLoopDispatcher>(time_keeper_.get())); async_set_default_dispatcher(dispatchers_[0].get()); printf("\nTEST_LOOP_RANDOM_SEED=\"%u\"\n", initial_state_); @@ -108,9 +108,9 @@ async_dispatcher_t* TestLoop::dispatcher() { } fbl::unique_ptr<LoopInterface> TestLoop::StartNewLoop() { - dispatchers_.push_back(fbl::make_unique<TestLoopDispatcher>(time_keeper_.get())); + dispatchers_.push_back(std::make_unique<TestLoopDispatcher>(time_keeper_.get())); auto* new_dispatcher = dispatchers_[dispatchers_.size() - 1].get(); - return fbl::make_unique<TestLoopInterface>(this, new_dispatcher); + return std::make_unique<TestLoopInterface>(this, new_dispatcher); } zx::time TestLoop::Now() const { diff --git a/zircon/system/ulib/async-testutils/test_loop_dispatcher.cpp b/zircon/system/ulib/async-testutils/test_loop_dispatcher.cpp index d9211b83c52..abb4297509e 100644 --- a/zircon/system/ulib/async-testutils/test_loop_dispatcher.cpp +++ b/zircon/system/ulib/async-testutils/test_loop_dispatcher.cpp @@ -124,7 +124,7 @@ zx_status_t TestLoopDispatcher::BeginWait(async_wait_t* wait) { return ZX_ERR_CANCELED; } - activables_.push_back(fbl::make_unique<WaitActivable>(this, wait)); + activables_.push_back(std::make_unique<WaitActivable>(this, wait)); return ZX_OK; } @@ -198,7 +198,7 @@ void TestLoopDispatcher::ExtractActivated() { // Move all tasks that reach their deadline to the activable list. while (!future_tasks_.empty() && (*future_tasks_.begin())->deadline <= Now().get()) { - activables_.push_back(fbl::make_unique<TaskActivable>(this, (*future_tasks_.begin()))); + activables_.push_back(std::make_unique<TaskActivable>(this, (*future_tasks_.begin()))); future_tasks_.erase(future_tasks_.begin()); } diff --git a/zircon/system/ulib/blobfs/blob.cpp b/zircon/system/ulib/blobfs/blob.cpp index 67a333528e4..570f9cbeaac 100644 --- a/zircon/system/ulib/blobfs/blob.cpp +++ b/zircon/system/ulib/blobfs/blob.cpp @@ -306,7 +306,7 @@ zx_status_t Blob::SpaceAllocate(uint64_t size_data) { return ZX_ERR_BAD_STATE; } - auto write_info = fbl::make_unique<WritebackInfo>(); + auto write_info = std::make_unique<WritebackInfo>(); // Initialize the inode with known fields. memset(inode_.merkle_root_hash, 0, Digest::kLength); diff --git a/zircon/system/ulib/blobfs/blobfs.cpp b/zircon/system/ulib/blobfs/blobfs.cpp index e970d016cef..c6179d27f4e 100644 --- a/zircon/system/ulib/blobfs/blobfs.cpp +++ b/zircon/system/ulib/blobfs/blobfs.cpp @@ -589,7 +589,7 @@ zx_status_t Blobfs::Create(fbl::unique_fd fd, const MountOptions& options, const return status; } - fs->allocator_ = fbl::make_unique<Allocator>(fs.get(), std::move(block_map), + fs->allocator_ = std::make_unique<Allocator>(fs.get(), std::move(block_map), std::move(node_map), std::move(nodes_bitmap)); if ((status = fs->allocator_->ResetFromStorage(fs::ReadTxn(fs.get()))) != ZX_OK) { FS_TRACE_ERROR("blobfs: Failed to load bitmaps: %d\n", status); diff --git a/zircon/system/ulib/blobfs/directory.cpp b/zircon/system/ulib/blobfs/directory.cpp index 6a3b0ee4f8a..82c17839c9c 100644 --- a/zircon/system/ulib/blobfs/directory.cpp +++ b/zircon/system/ulib/blobfs/directory.cpp @@ -234,7 +234,7 @@ private: #ifdef __Fuchsia__ zx_status_t Directory::Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) { - return vfs->ServeConnection(fbl::make_unique<DirectoryConnection>( + return vfs->ServeConnection(std::make_unique<DirectoryConnection>( vfs, fbl::WrapRefPtr(this), std::move(channel), flags)); } #endif diff --git a/zircon/system/ulib/blobfs/journal.cpp b/zircon/system/ulib/blobfs/journal.cpp index 6b99c8a2bdc..3aebd9da3fd 100644 --- a/zircon/system/ulib/blobfs/journal.cpp +++ b/zircon/system/ulib/blobfs/journal.cpp @@ -399,7 +399,7 @@ fbl::unique_ptr<JournalEntry> Journal::CreateEntry(uint64_t header_index, uint64 status = EntryStatus::kError; } - return fbl::make_unique<JournalEntry>(this, status, header_index, commit_index, + return std::make_unique<JournalEntry>(this, status, header_index, commit_index, std::move(work)); } diff --git a/zircon/system/ulib/blobfs/test/journal-test.cpp b/zircon/system/ulib/blobfs/test/journal-test.cpp index a2f85dc742e..4b6e82a8a36 100644 --- a/zircon/system/ulib/blobfs/test/journal-test.cpp +++ b/zircon/system/ulib/blobfs/test/journal-test.cpp @@ -59,7 +59,7 @@ private: } fbl::unique_ptr<WritebackWork> CreateWork() final { - return fbl::make_unique<WritebackWork>(nullptr); + return std::make_unique<WritebackWork>(nullptr); } // The following functions are no-ops, and only exist so they can be called by the diff --git a/zircon/system/ulib/blobfs/test/utils.cpp b/zircon/system/ulib/blobfs/test/utils.cpp index 20df80e5a8e..74d41be5704 100644 --- a/zircon/system/ulib/blobfs/test/utils.cpp +++ b/zircon/system/ulib/blobfs/test/utils.cpp @@ -25,7 +25,7 @@ bool InitializeAllocator(size_t blocks, size_t nodes, MockSpaceManager* space_ma space_manager->MutableInfo().data_block_count = blocks; std::unique_ptr<IdAllocator> nodes_bitmap = {}; ASSERT_EQ(ZX_OK, IdAllocator::Create(nodes, &nodes_bitmap), "nodes bitmap"); - *out = fbl::make_unique<Allocator>(space_manager, std::move(block_map), std::move(node_map), + *out = std::make_unique<Allocator>(space_manager, std::move(block_map), std::move(node_map), std::move(nodes_bitmap)); (*out)->SetLogging(false); END_HELPER; diff --git a/zircon/system/ulib/ddktl/test/ethernet-tests.cpp b/zircon/system/ulib/ddktl/test/ethernet-tests.cpp index 17f088dc617..5adaf82cdfe 100644 --- a/zircon/system/ulib/ddktl/test/ethernet-tests.cpp +++ b/zircon/system/ulib/ddktl/test/ethernet-tests.cpp @@ -101,7 +101,7 @@ public: zx_status_t EthmacStart(const ethmac_ifc_protocol_t* ifc) { start_this_ = get_this(); - client_ = fbl::make_unique<ddk::EthmacIfcProtocolClient>(ifc); + client_ = std::make_unique<ddk::EthmacIfcProtocolClient>(ifc); start_called_ = true; return ZX_OK; } diff --git a/zircon/system/ulib/devmgr-integration-test/launcher.cpp b/zircon/system/ulib/devmgr-integration-test/launcher.cpp index 8aab78a1526..1a49e97e646 100644 --- a/zircon/system/ulib/devmgr-integration-test/launcher.cpp +++ b/zircon/system/ulib/devmgr-integration-test/launcher.cpp @@ -66,7 +66,7 @@ int bootsvc_main(void* arg) { root->AddEntry(fuchsia_boot_Items_Name, node); // Serve VFS on channel. - auto conn = fbl::make_unique<fs::Connection>(&vfs, root, std::move(data->server), + auto conn = std::make_unique<fs::Connection>(&vfs, root, std::move(data->server), ZX_FS_FLAG_DIRECTORY | ZX_FS_RIGHT_READABLE | ZX_FS_RIGHT_WRITABLE); diff --git a/zircon/system/ulib/fbl/include/fbl/function.h b/zircon/system/ulib/fbl/include/fbl/function.h index 90a1e94d59b..4295ba1045c 100644 --- a/zircon/system/ulib/fbl/include/fbl/function.h +++ b/zircon/system/ulib/fbl/include/fbl/function.h @@ -113,7 +113,7 @@ template <typename Callable, typename Result, typename... Args> class HeapFunctionTarget final : public FunctionTarget<Result, Args...> { public: explicit HeapFunctionTarget(Callable target) - : target_ptr_(fbl::make_unique<Callable>(std::move(target))) {} + : target_ptr_(std::make_unique<Callable>(std::move(target))) {} HeapFunctionTarget(Callable target, AllocChecker* ac) : target_ptr_(fbl::make_unique_checked<Callable>(ac, std::move(target))) {} HeapFunctionTarget(HeapFunctionTarget&& other) diff --git a/zircon/system/ulib/fbl/include/fbl/unique_ptr.h b/zircon/system/ulib/fbl/include/fbl/unique_ptr.h index d756bd44f92..5c6b5742e3d 100644 --- a/zircon/system/ulib/fbl/include/fbl/unique_ptr.h +++ b/zircon/system/ulib/fbl/include/fbl/unique_ptr.h @@ -45,20 +45,6 @@ struct unique_type<T[]> { } // namespace internal -// Constructs a new object and assigns it to a unique_ptr. -template <typename T, typename... Args> -typename internal::unique_type<T>::single -make_unique(Args&&... args) { - return unique_ptr<T>(new T(std::forward<Args>(args)...)); -} - -template <typename T, typename... Args> -typename internal::unique_type<T>::incomplete_array -make_unique(size_t size) { - using single_type = std::remove_extent_t<T>; - return unique_ptr<single_type[]>(new single_type[size]()); -} - template <typename T, typename... Args> typename internal::unique_type<T>::single make_unique_checked(AllocChecker* ac, Args&&... args) { diff --git a/zircon/system/ulib/fs/pseudo-dir.cpp b/zircon/system/ulib/fs/pseudo-dir.cpp index c52bd926a0d..157de83475a 100644 --- a/zircon/system/ulib/fs/pseudo-dir.cpp +++ b/zircon/system/ulib/fs/pseudo-dir.cpp @@ -106,7 +106,7 @@ zx_status_t PseudoDir::AddEntry(fbl::String name, fbl::RefPtr<fs::Vnode> vn) { } Notify(name.ToStringPiece(), fuchsia_io_WATCH_EVENT_ADDED); - auto entry = fbl::make_unique<Entry>(next_node_id_++, + auto entry = std::make_unique<Entry>(next_node_id_++, std::move(name), std::move(vn)); entries_by_name_.insert(entry.get()); entries_by_id_.insert(std::move(entry)); diff --git a/zircon/system/ulib/fs/vnode.cpp b/zircon/system/ulib/fs/vnode.cpp index 0f7cac2d785..b6fc6bf8a45 100644 --- a/zircon/system/ulib/fs/vnode.cpp +++ b/zircon/system/ulib/fs/vnode.cpp @@ -18,7 +18,7 @@ Vnode::~Vnode() = default; #ifdef __Fuchsia__ zx_status_t Vnode::Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) { - return vfs->ServeConnection(fbl::make_unique<Connection>( + return vfs->ServeConnection(std::make_unique<Connection>( vfs, fbl::WrapRefPtr(this), std::move(channel), flags)); } diff --git a/zircon/system/ulib/fvm-host/file-wrapper.cpp b/zircon/system/ulib/fvm-host/file-wrapper.cpp index 1cbdcb64d64..6f7a383a471 100644 --- a/zircon/system/ulib/fvm-host/file-wrapper.cpp +++ b/zircon/system/ulib/fvm-host/file-wrapper.cpp @@ -44,7 +44,7 @@ zx_status_t UniqueFdWrapper::Open( return ZX_ERR_IO; } - *out = fbl::make_unique<UniqueFdWrapper>(std::move(fd)); + *out = std::make_unique<UniqueFdWrapper>(std::move(fd)); return ZX_OK; } diff --git a/zircon/system/ulib/fvm-host/fvm-info.cpp b/zircon/system/ulib/fvm-host/fvm-info.cpp index 4601ec836ca..439b813c737 100644 --- a/zircon/system/ulib/fvm-host/fvm-info.cpp +++ b/zircon/system/ulib/fvm-host/fvm-info.cpp @@ -95,7 +95,7 @@ zx_status_t FvmInfo::Load(fvm::host::FileWrapper* file, uint64_t disk_offset, ui size_t old_slice_size = SuperBlock()->slice_size; size_t old_metadata_size = fvm::MetadataSize(disk_size, old_slice_size); fbl::unique_ptr<uint8_t[]> old_metadata = - fbl::make_unique<uint8_t[]>(old_metadata_size * 2); + std::make_unique<uint8_t[]>(old_metadata_size * 2); // Read remainder of metadata. file->Seek(disk_offset, SEEK_SET); diff --git a/zircon/system/ulib/inspect-vmo/include/lib/inspect-vmo/snapshot.h b/zircon/system/ulib/inspect-vmo/include/lib/inspect-vmo/snapshot.h index c97cda55efc..60f328ad7d3 100644 --- a/zircon/system/ulib/inspect-vmo/include/lib/inspect-vmo/snapshot.h +++ b/zircon/system/ulib/inspect-vmo/include/lib/inspect-vmo/snapshot.h @@ -28,7 +28,7 @@ namespace vmo { // Test Example: // zx_status_t status = Snapshot::Create(std::move(vmo), // {.read_attempts = 1024, .skip_consistency_check = false}, -// fbl::make_unique<TestCallback>(), +// std::make_unique<TestCallback>(), // &snapshot); class Snapshot final { public: diff --git a/zircon/system/ulib/kms-stateless/kms-stateless.cpp b/zircon/system/ulib/kms-stateless/kms-stateless.cpp index 2e2f09a02bb..fe7d295f874 100644 --- a/zircon/system/ulib/kms-stateless/kms-stateless.cpp +++ b/zircon/system/ulib/kms-stateless/kms-stateless.cpp @@ -73,7 +73,7 @@ public: return fbl::unique_ptr<ScopedTeecSession>(); } fbl::unique_ptr<ScopedTeecSession> session_ptr = - fbl::make_unique<ScopedTeecSession>(session); + std::make_unique<ScopedTeecSession>(session); return session_ptr; } diff --git a/zircon/system/ulib/memfs/memfs-local.cpp b/zircon/system/ulib/memfs/memfs-local.cpp index a98a6785429..ab0ed59a9c5 100644 --- a/zircon/system/ulib/memfs/memfs-local.cpp +++ b/zircon/system/ulib/memfs/memfs-local.cpp @@ -49,7 +49,7 @@ zx_status_t memfs_create_filesystem_with_page_limit(async_dispatcher_t* dispatch return status; } - fbl::unique_ptr<memfs_filesystem_t> fs = fbl::make_unique<memfs_filesystem_t>(max_num_pages); + fbl::unique_ptr<memfs_filesystem_t> fs = std::make_unique<memfs_filesystem_t>(max_num_pages); fs->vfs.SetDispatcher(dispatcher); fbl::RefPtr<memfs::VnodeDir> root; diff --git a/zircon/system/ulib/minfs/vnode.cpp b/zircon/system/ulib/minfs/vnode.cpp index 9ada18a5540..df845d466b1 100644 --- a/zircon/system/ulib/minfs/vnode.cpp +++ b/zircon/system/ulib/minfs/vnode.cpp @@ -1339,7 +1339,7 @@ zx_status_t VnodeMinfs::ValidateFlags(uint32_t flags) { #ifdef __Fuchsia__ zx_status_t VnodeMinfs::Serve(fs::Vfs* vfs, zx::channel channel, uint32_t flags) { - return vfs->ServeConnection(fbl::make_unique<MinfsConnection>( + return vfs->ServeConnection(std::make_unique<MinfsConnection>( vfs, fbl::WrapRefPtr(this), std::move(channel), flags)); } #endif diff --git a/zircon/system/ulib/trace-provider/session.cpp b/zircon/system/ulib/trace-provider/session.cpp index 480d28b7e5e..58a2b4f1983 100644 --- a/zircon/system/ulib/trace-provider/session.cpp +++ b/zircon/system/ulib/trace-provider/session.cpp @@ -32,7 +32,7 @@ Session::Session(void* buffer, size_t buffer_num_bytes, enabled_categories_(std::move(enabled_categories)) { // Build a quick lookup table for IsCategoryEnabled(). for (const auto& cat : enabled_categories_) { - auto entry = fbl::make_unique<StringSetEntry>(cat.c_str()); + auto entry = std::make_unique<StringSetEntry>(cat.c_str()); enabled_category_set_.insert_or_find(std::move(entry)); } } diff --git a/zircon/system/ulib/trace-reader/reader.cpp b/zircon/system/ulib/trace-reader/reader.cpp index 4bd16a64db1..a2c395d265a 100644 --- a/zircon/system/ulib/trace-reader/reader.cpp +++ b/zircon/system/ulib/trace-reader/reader.cpp @@ -564,7 +564,7 @@ void TraceReader::SetCurrentProvider(ProviderId id) { } void TraceReader::RegisterProvider(ProviderId id, fbl::String name) { - auto provider = fbl::make_unique<ProviderInfo>(); + auto provider = std::make_unique<ProviderInfo>(); provider->id = id; provider->name = name; current_provider_ = provider.get(); @@ -576,7 +576,7 @@ void TraceReader::RegisterString(trace_string_index_t index, fbl::String string) ZX_DEBUG_ASSERT(index >= TRACE_ENCODED_STRING_REF_MIN_INDEX && index <= TRACE_ENCODED_STRING_REF_MAX_INDEX); - auto entry = fbl::make_unique<StringTableEntry>(index, string); + auto entry = std::make_unique<StringTableEntry>(index, string); current_provider_->string_table.insert_or_replace(std::move(entry)); } @@ -585,7 +585,7 @@ void TraceReader::RegisterThread(trace_thread_index_t index, ZX_DEBUG_ASSERT(index >= TRACE_ENCODED_THREAD_REF_MIN_INDEX && index <= TRACE_ENCODED_THREAD_REF_MAX_INDEX); - auto entry = fbl::make_unique<ThreadTableEntry>(index, process_thread); + auto entry = std::make_unique<ThreadTableEntry>(index, process_thread); current_provider_->thread_table.insert_or_replace(std::move(entry)); } diff --git a/zircon/system/utest/async-testutils/test_loop_tests.cpp b/zircon/system/utest/async-testutils/test_loop_tests.cpp index a2ae67afe0b..ad7680ace7e 100644 --- a/zircon/system/utest/async-testutils/test_loop_tests.cpp +++ b/zircon/system/utest/async-testutils/test_loop_tests.cpp @@ -455,7 +455,7 @@ bool HugeAmountOfTaskAreDispatched() { size_t wait_count = 0; // Creating the array on the heap as its size is greater than the available // stack. - auto waits_ptr = fbl::make_unique<std::array<async::Wait, kPostCount>>(); + auto waits_ptr = std::make_unique<std::array<async::Wait, kPostCount>>(); auto& waits = *waits_ptr; for (size_t i = 0; i < kPostCount; ++i) { diff --git a/zircon/system/utest/cobalt-client/cobalt_logger_test.cpp b/zircon/system/utest/cobalt-client/cobalt_logger_test.cpp index dacc377d1cb..d52b9a82f0d 100644 --- a/zircon/system/utest/cobalt-client/cobalt_logger_test.cpp +++ b/zircon/system/utest/cobalt-client/cobalt_logger_test.cpp @@ -382,7 +382,7 @@ private: Context() { services.loop = - std::move(fbl::make_unique<async::Loop>(&kAsyncLoopConfigNoAttachToThread)); + std::move(std::make_unique<async::Loop>(&kAsyncLoopConfigNoAttachToThread)); } struct ReturnValues { @@ -420,7 +420,7 @@ private: return_values.service_connect); } fbl::unique_ptr<CobaltLogger> logger = - fbl::make_unique<CobaltLogger>(std::move(options)); + std::make_unique<CobaltLogger>(std::move(options)); services.loop->StartThread("FactoryServiceThread"); return logger; } diff --git a/zircon/system/utest/core/pager/pager.cpp b/zircon/system/utest/core/pager/pager.cpp index ad1daf587c3..ca22872c9b8 100644 --- a/zircon/system/utest/core/pager/pager.cpp +++ b/zircon/system/utest/core/pager/pager.cpp @@ -190,7 +190,7 @@ bool concurrent_overlapping_access_test(bool check_vmar) { constexpr uint64_t kNumThreads = 32; fbl::unique_ptr<TestThread> threads[kNumThreads]; for (unsigned i = 0; i < kNumThreads; i++) { - threads[i] = fbl::make_unique<TestThread>([vmo, check_vmar]() -> bool { + threads[i] = std::make_unique<TestThread>([vmo, check_vmar]() -> bool { return check_buffer(vmo, 0, 1, check_vmar); }); @@ -225,7 +225,7 @@ bool bulk_single_supply_test(bool check_vmar) { fbl::unique_ptr<TestThread> ts[kNumPages]; for (unsigned i = 0; i < kNumPages; i++) { - ts[i] = fbl::make_unique<TestThread>([vmo, i, check_vmar]() -> bool { + ts[i] = std::make_unique<TestThread>([vmo, i, check_vmar]() -> bool { return check_buffer(vmo, i, 1, check_vmar); }); ASSERT_TRUE(ts[i]->Start()); @@ -269,7 +269,7 @@ bool bulk_odd_supply_test_inner(bool check_vmar, bool use_src_offset) { fbl::unique_ptr<TestThread> ts[kSupplyLengths[supply_idx]]; for (uint64_t j = 0; j < kSupplyLengths[supply_idx]; j++) { uint64_t thread_offset = offset + j; - ts[j] = fbl::make_unique<TestThread>([vmo, thread_offset, check_vmar]() -> bool { + ts[j] = std::make_unique<TestThread>([vmo, thread_offset, check_vmar]() -> bool { return check_buffer(vmo, thread_offset, 1, check_vmar); }); ASSERT_TRUE(ts[j]->Start()); @@ -348,7 +348,7 @@ bool many_request_test(bool check_vmar) { fbl::unique_ptr<TestThread> ts[kNumPages]; for (unsigned i = 0; i < kNumPages; i++) { - ts[i] = fbl::make_unique<TestThread>([vmo, i, check_vmar]() -> bool { + ts[i] = std::make_unique<TestThread>([vmo, i, check_vmar]() -> bool { return check_buffer(vmo, i, 1, check_vmar); }); ASSERT_TRUE(ts[i]->Start()); @@ -409,7 +409,7 @@ bool multiple_concurrent_vmo_test() { for (unsigned i = 0; i < kNumVmos; i++) { ASSERT_TRUE(pager.CreateVmo(1, vmos + i)); - ts[i] = fbl::make_unique<TestThread>([vmo = vmos[i]]() -> bool { + ts[i] = std::make_unique<TestThread>([vmo = vmos[i]]() -> bool { return check_buffer(vmo, 0, 1, true); }); @@ -468,7 +468,7 @@ bool vmar_remap_test() { fbl::unique_ptr<TestThread> ts[kNumPages]; for (unsigned i = 0; i < kNumPages; i++) { - ts[i] = fbl::make_unique<TestThread>([vmo, i]() -> bool { + ts[i] = std::make_unique<TestThread>([vmo, i]() -> bool { return check_buffer(vmo, i, 1, true); }); ASSERT_TRUE(ts[i]->Start()); @@ -1328,7 +1328,7 @@ bool overlap_commit_supply_test() { fbl::unique_ptr<TestThread> tsA[kNumPages / kCommitLenA]; for (unsigned i = 0; i < fbl::count_of(tsA); i++) { - tsA[i] = fbl::make_unique<TestThread>([vmo, i]() -> bool { + tsA[i] = std::make_unique<TestThread>([vmo, i]() -> bool { return vmo->Commit(i * kCommitLenA, kCommitLenA); }); @@ -1338,7 +1338,7 @@ bool overlap_commit_supply_test() { fbl::unique_ptr<TestThread> tsB[kNumPages / kCommitLenB]; for (unsigned i = 0; i < fbl::count_of(tsB); i++) { - tsB[i] = fbl::make_unique<TestThread>([vmo, i]() -> bool { + tsB[i] = std::make_unique<TestThread>([vmo, i]() -> bool { return vmo->Commit(i * kCommitLenB, kCommitLenB); }); @@ -1404,7 +1404,7 @@ bool multicommit_supply_test() { fbl::unique_ptr<TestThread> ts[kNumCommits]; for (unsigned i = 0; i < kNumCommits; i++) { - ts[i] = fbl::make_unique<TestThread>([vmo, i]() -> bool { + ts[i] = std::make_unique<TestThread>([vmo, i]() -> bool { return vmo->Commit(i * kNumSupplies, kNumSupplies); }); ASSERT_TRUE(ts[i]->Start()); diff --git a/zircon/system/utest/core/pager/userpager.cpp b/zircon/system/utest/core/pager/userpager.cpp index 080e7e1ff69..72e62c186dd 100644 --- a/zircon/system/utest/core/pager/userpager.cpp +++ b/zircon/system/utest/core/pager/userpager.cpp @@ -250,7 +250,7 @@ bool UserPager::WaitForRequest(fbl::Function<bool(const zx_port_packet_t& packet return true; } - auto req = fbl::make_unique<request>(); + auto req = std::make_unique<request>(); req->req = actual_packet; requests_.push_front(std::move(req)); } else { diff --git a/zircon/system/utest/fbl/function_tests.cpp b/zircon/system/utest/fbl/function_tests.cpp index 17189370de6..b14fa76e3d1 100644 --- a/zircon/system/utest/fbl/function_tests.cpp +++ b/zircon/system/utest/fbl/function_tests.cpp @@ -604,7 +604,7 @@ bool bind_member() { BEGIN_TEST; Obj obj; - auto move_only_value = fbl::make_unique<int>(4); + auto move_only_value = std::make_unique<int>(4); BindMember(&obj, &Obj::Call)(); EXPECT_EQ(23, BindMember(&obj, &Obj::AddOne)(22)); diff --git a/zircon/system/utest/fbl/unique_ptr_tests.cpp b/zircon/system/utest/fbl/unique_ptr_tests.cpp index 4ef228e139d..c46b5229dbe 100644 --- a/zircon/system/utest/fbl/unique_ptr_tests.cpp +++ b/zircon/system/utest/fbl/unique_ptr_tests.cpp @@ -572,7 +572,7 @@ static bool uptr_test_make_unique() { // no alloc checker destroy_count = 0; { - CountingPtr ptr = fbl::make_unique<DeleteCounter>(42); + CountingPtr ptr = std::make_unique<DeleteCounter>(42); EXPECT_EQ(42, ptr->value, "value"); } EXPECT_EQ(1, destroy_count); @@ -598,7 +598,7 @@ static bool uptr_test_make_unique_array() { // no alloc checker destroy_count = 0; { - CountingArrPtr ptr = fbl::make_unique<DeleteCounter[]>(array_size); + CountingArrPtr ptr = std::make_unique<DeleteCounter[]>(array_size); EXPECT_NONNULL(ptr); for (size_t i = 0; i < array_size; ++i) { EXPECT_EQ(0, ptr[i].value); diff --git a/zircon/system/utest/fs-vnode/teardown-tests.cpp b/zircon/system/utest/fs-vnode/teardown-tests.cpp index ebf29b0fcab..4ebd6fb00bb 100644 --- a/zircon/system/utest/fs-vnode/teardown-tests.cpp +++ b/zircon/system/utest/fs-vnode/teardown-tests.cpp @@ -110,7 +110,7 @@ bool send_sync(const zx::channel& client) { bool sync_start(sync_completion_t* completions, async::Loop* loop, fbl::unique_ptr<fs::ManagedVfs>* vfs) { BEGIN_HELPER; - *vfs = fbl::make_unique<fs::ManagedVfs>(loop->dispatcher()); + *vfs = std::make_unique<fs::ManagedVfs>(loop->dispatcher()); ASSERT_EQ(loop->StartThread(), ZX_OK); auto vn = fbl::AdoptRef(new AsyncTearDownVnode(completions)); @@ -260,7 +260,7 @@ bool TestTeardownSlowClone() { async::Loop loop(&kAsyncLoopConfigNoAttachToThread); sync_completion_t completions[3]; - auto vfs = fbl::make_unique<fs::ManagedVfs>(loop.dispatcher()); + auto vfs = std::make_unique<fs::ManagedVfs>(loop.dispatcher()); ASSERT_EQ(loop.StartThread(), ZX_OK); auto vn = fbl::AdoptRef(new AsyncTearDownVnode(completions)); @@ -318,7 +318,7 @@ bool TestSynchronousTeardown() { { // Tear down the VFS while the async loop is running. - auto vfs = fbl::make_unique<fs::SynchronousVfs>(loop.dispatcher()); + auto vfs = std::make_unique<fs::SynchronousVfs>(loop.dispatcher()); auto vn = fbl::AdoptRef(new FdCountVnode()); zx::channel server; ASSERT_EQ(zx::channel::create(0, &client, &server), ZX_OK); @@ -330,7 +330,7 @@ bool TestSynchronousTeardown() { { // Tear down the VFS while the async loop is not running. - auto vfs = fbl::make_unique<fs::SynchronousVfs>(loop.dispatcher()); + auto vfs = std::make_unique<fs::SynchronousVfs>(loop.dispatcher()); auto vn = fbl::AdoptRef(new FdCountVnode()); zx::channel server; ASSERT_EQ(zx::channel::create(0, &client, &server), ZX_OK); @@ -340,7 +340,7 @@ bool TestSynchronousTeardown() { { // Tear down the VFS with no active connections. - auto vfs = fbl::make_unique<fs::SynchronousVfs>(loop.dispatcher()); + auto vfs = std::make_unique<fs::SynchronousVfs>(loop.dispatcher()); } END_TEST; diff --git a/zircon/system/utest/inspect-vmo/inspect_tests.cpp b/zircon/system/utest/inspect-vmo/inspect_tests.cpp index 9866d1640aa..8e888f857e9 100644 --- a/zircon/system/utest/inspect-vmo/inspect_tests.cpp +++ b/zircon/system/utest/inspect-vmo/inspect_tests.cpp @@ -18,7 +18,7 @@ bool CreateDeleteActive() { Object object; { - auto inspector = fbl::make_unique<Inspector>(); + auto inspector = std::make_unique<Inspector>(); object = inspector->CreateObject("object"); EXPECT_TRUE(object); Object child = object.CreateChild("child"); diff --git a/zircon/system/utest/inspect-vmo/state_tests.cpp b/zircon/system/utest/inspect-vmo/state_tests.cpp index abc94ab3fb2..e4cb7354dbd 100644 --- a/zircon/system/utest/inspect-vmo/state_tests.cpp +++ b/zircon/system/utest/inspect-vmo/state_tests.cpp @@ -112,7 +112,7 @@ Snapshot SnapshotAndScan(const zx::vmo& vmo, } else { *allocated_blocks += 1; } - blocks->insert(fbl::make_unique<ScannedBlock>(index, block)); + blocks->insert(std::make_unique<ScannedBlock>(index, block)); }); } return snapshot; @@ -123,7 +123,7 @@ bool CreateIntMetric() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); IntMetric a = state->CreateIntMetric("a", 0, 0); @@ -178,7 +178,7 @@ bool CreateUintMetric() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); UintMetric a = state->CreateUintMetric("a", 0, 0); @@ -233,7 +233,7 @@ bool CreateDoubleMetric() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); DoubleMetric a = state->CreateDoubleMetric("a", 0, 0); @@ -288,7 +288,7 @@ bool CreateSmallProperties() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); Property a = state->CreateProperty("a", 0, "Hello", PropertyFormat::kUtf8); @@ -343,7 +343,7 @@ bool CreateLargeSingleExtentProperties() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); char input[] = "abcdefg"; @@ -411,7 +411,7 @@ bool CreateMultiExtentProperty() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); char input[] = "abcdefg"; @@ -473,7 +473,7 @@ bool SetSmallProperty() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); struct test_case { @@ -523,7 +523,7 @@ bool SetLargeProperty() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); char input[] = "abcdefg"; @@ -572,7 +572,7 @@ bool SetPropertyOutOfMemory() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo), 16 * 1024); + auto heap = std::make_unique<Heap>(std::move(vmo), 16 * 1024); auto state = State::Create(std::move(heap)); fbl::Vector<char> vec; @@ -602,7 +602,7 @@ bool CreateObjectHierarchy() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); Object root = state->CreateObject("objects", 0); @@ -693,7 +693,7 @@ bool TombstoneTest() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); fbl::unique_ptr<Object> requests; @@ -701,7 +701,7 @@ bool TombstoneTest() { // Root going out of scope causes a tombstone to be created, // but since requests is referencing it it will not be deleted. Object root = state->CreateObject("objects", 0); - requests = fbl::make_unique<Object>(root.CreateChild("requests")); + requests = std::make_unique<Object>(root.CreateChild("requests")); auto a = root.CreateIntMetric("a", 1); auto b = root.CreateUintMetric("b", 1); auto c = root.CreateDoubleMetric("c", 1); @@ -747,7 +747,7 @@ bool TombstoneCleanup() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); IntMetric metric = state->CreateIntMetric("a", 0, 0); @@ -852,7 +852,7 @@ bool MultithreadingTest() { auto vmo = fzl::ResizeableVmoMapper::Create(4096, "test"); ASSERT_TRUE(vmo != nullptr); - auto heap = fbl::make_unique<Heap>(std::move(vmo)); + auto heap = std::make_unique<Heap>(std::move(vmo)); auto state = State::Create(std::move(heap)); size_t per_thread_times_operation_count = 0; diff --git a/zircon/system/utest/libfzl/owned-vmo-mapper-tests.cpp b/zircon/system/utest/libfzl/owned-vmo-mapper-tests.cpp index a79c9c706ca..bc4be50dce0 100644 --- a/zircon/system/utest/libfzl/owned-vmo-mapper-tests.cpp +++ b/zircon/system/utest/libfzl/owned-vmo-mapper-tests.cpp @@ -56,7 +56,7 @@ bool UncheckedCreateHelper(fbl::unique_ptr<fzl::OwnedVmoMapper>* out_mapper, } ASSERT_NONNULL(out_mapper); - auto mapper = fbl::make_unique<fzl::OwnedVmoMapper>(); + auto mapper = std::make_unique<fzl::OwnedVmoMapper>(); if (mapper->CreateAndMap(size, name, map_options, std::move(manager), cache_policy) == ZX_OK) { *out_mapper = std::move(mapper); } diff --git a/zircon/system/utest/logger/test.cpp b/zircon/system/utest/logger/test.cpp index 1fd09b87682..0f99f2579d9 100644 --- a/zircon/system/utest/logger/test.cpp +++ b/zircon/system/utest/logger/test.cpp @@ -52,7 +52,7 @@ public: ASSERT_NE(pipe2(pipefd_, O_NONBLOCK), -1, ""); zx::channel local, remote; ASSERT_EQ(ZX_OK, zx::channel::create(0, &local, &remote)); - logger_ = fbl::make_unique<logger::LoggerImpl>(std::move(remote), pipefd_[0]); + logger_ = std::make_unique<logger::LoggerImpl>(std::move(remote), pipefd_[0]); ASSERT_EQ(ZX_OK, logger_->Begin(loop_.dispatcher())); logger_handle_.reset(local.release()); logger_->set_error_handler([this](zx_status_t status) { diff --git a/zircon/system/utest/runtests-utils/log-exporter-test.cpp b/zircon/system/utest/runtests-utils/log-exporter-test.cpp index 6fbe414c689..aa02c288890 100644 --- a/zircon/system/utest/runtests-utils/log-exporter-test.cpp +++ b/zircon/system/utest/runtests-utils/log-exporter-test.cpp @@ -163,7 +163,7 @@ bool TestLog() { FILE* buf_file = fmemopen(buf, sizeof(buf), "w"); // start listener - auto log_listener = fbl::make_unique<LogExporter>(std::move(listener_request), buf_file); + auto log_listener = std::make_unique<LogExporter>(std::move(listener_request), buf_file); log_listener->set_error_handler([](zx_status_t status) { EXPECT_EQ(ZX_ERR_CANCELED, status); }); @@ -206,7 +206,7 @@ bool TestLogMany() { FILE* buf_file = fmemopen(buf, sizeof(buf), "w"); // start listener - auto log_listener = fbl::make_unique<LogExporter>(std::move(listener_request), buf_file); + auto log_listener = std::make_unique<LogExporter>(std::move(listener_request), buf_file); log_listener->set_error_handler([](zx_status_t status) { EXPECT_EQ(ZX_ERR_CANCELED, status); }); @@ -252,7 +252,7 @@ bool TestDroppedLogs() { FILE* buf_file = fmemopen(buf, sizeof(buf), "w"); // start listener - auto log_listener = fbl::make_unique<LogExporter>(std::move(listener_request), buf_file); + auto log_listener = std::make_unique<LogExporter>(std::move(listener_request), buf_file); log_listener->set_error_handler([](zx_status_t status) { EXPECT_EQ(ZX_ERR_CANCELED, status); }); -- GitLab