From 87d9e252692b6cc1f0704ad4f041f447e85a3b7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Semenov=20Herman=20=28=D0=A1=D0=B5=D0=BC=D0=B5=D0=BD=D0=BE?=
 =?UTF-8?q?=D0=B2=20=D0=93=D0=B5=D1=80=D0=BC=D0=B0=D0=BD=29?=
 <GermanAizek@yandex.ru>
Date: Sat, 4 Jan 2025 22:04:33 +0300
Subject: [PATCH] refactor: migration to std::make_unique C++17
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Semenov Herman (Семенов Герман) <GermanAizek@yandex.ru>
---
 opencl/source/command_queue/command_queue.cpp |  4 ++--
 .../sharings/va/va_sharing_functions.cpp      |  4 ++--
 opencl/source/utilities/cl_logger.cpp         |  4 ++--
 .../source/ocloc_arg_helper.cpp               |  4 ++--
 shared/source/ail/ail_configuration.h         |  5 ++---
 shared/source/built_ins/built_ins_storage.cpp |  6 +++---
 .../source/command_container/cmdcontainer.cpp |  4 ++--
 shared/source/dll/create_deferred_deleter.cpp |  4 ++--
 .../os_interface/linux/drm_memory_manager.cpp |  8 ++++----
 .../linux/ioctl_helper_prelim.cpp             |  4 ++--
 .../os_interface/linux/os_thread_linux.cpp    |  4 ++--
 .../os_interface/linux/os_time_linux.cpp      |  4 ++--
 .../source/os_interface/windows/wddm/wddm.cpp | 20 +++++++++----------
 shared/source/program/print_formatter.cpp     |  4 ++--
 shared/source/utilities/idlist.h              |  4 ++--
 shared/source/utilities/iflist.h              |  4 ++--
 shared/source/utilities/perf_profiler.cpp     | 10 +++++-----
 17 files changed, 48 insertions(+), 49 deletions(-)

diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp
index 6f8c8f2dbe794..75df46ae23d06 100644
--- a/opencl/source/command_queue/command_queue.cpp
+++ b/opencl/source/command_queue/command_queue.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2024 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -903,7 +903,7 @@ void CommandQueue::enqueueBlockedMapUnmapOperation(const cl_event *eventWaitList
     }
 
     // store task data in event
-    auto cmd = std::unique_ptr<Command>(new CommandMapUnmap(opType, *memObj, copySize, copyOffset, readOnly, *this));
+    auto cmd = std::make_unique<CommandMapUnmap>(opType, *memObj, copySize, copyOffset, readOnly, *this);
     eventBuilder->getEvent()->setCommand(std::move(cmd));
 
     // bind output event with input events
diff --git a/opencl/source/sharings/va/va_sharing_functions.cpp b/opencl/source/sharings/va/va_sharing_functions.cpp
index 6800170b7d122..f03cf1c192da0 100644
--- a/opencl/source/sharings/va/va_sharing_functions.cpp
+++ b/opencl/source/sharings/va/va_sharing_functions.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2023 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -78,7 +78,7 @@ void VASharingFunctions::initFunctions() {
 void VASharingFunctions::querySupportedVaImageFormats(VADisplay vaDisplay) {
     int maxFormats = this->maxNumImageFormats(vaDisplay);
     if (maxFormats > 0) {
-        std::unique_ptr<VAImageFormat[]> allVaFormats(new VAImageFormat[maxFormats]);
+        auto allVaFormats = std::make_unique<VAImageFormat[]>(maxFormats);
         auto result = this->queryImageFormats(vaDisplay, allVaFormats.get(), &maxFormats);
         if (result == VA_STATUS_SUCCESS) {
             for (int i = 0; i < maxFormats; i++) {
diff --git a/opencl/source/utilities/cl_logger.cpp b/opencl/source/utilities/cl_logger.cpp
index 9bb3114b82024..f598e68f418fd 100644
--- a/opencl/source/utilities/cl_logger.cpp
+++ b/opencl/source/utilities/cl_logger.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021-2023 Intel Corporation
+ * Copyright (C) 2021-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -79,7 +79,7 @@ void ClFileLogger<debugLevel>::dumpKernelArgs(const MultiDispatchInfo *multiDisp
                 type = "immediate";
                 auto crossThreadData = kernel->getCrossThreadData();
                 auto crossThreadDataSize = kernel->getCrossThreadDataSize();
-                argVal = std::unique_ptr<char[]>(new char[crossThreadDataSize]);
+                argVal = std::make_unique<char[]>(crossThreadDataSize);
 
                 size_t totalArgSize = 0;
                 for (const auto &element : arg.as<ArgDescValue>().elements) {
diff --git a/shared/offline_compiler/source/ocloc_arg_helper.cpp b/shared/offline_compiler/source/ocloc_arg_helper.cpp
index 539263ba29a8e..c84c0c8513c88 100644
--- a/shared/offline_compiler/source/ocloc_arg_helper.cpp
+++ b/shared/offline_compiler/source/ocloc_arg_helper.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020-2024 Intel Corporation
+ * Copyright (C) 2020-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -143,7 +143,7 @@ std::vector<char> OclocArgHelper::readBinaryFile(const std::string &filename) {
 std::unique_ptr<char[]> OclocArgHelper::loadDataFromFile(const std::string &filename, size_t &retSize) {
     if (Source *s = findSourceFile(filename)) {
         auto size = s->length;
-        std::unique_ptr<char[]> ret(new char[size]());
+        auto ret = std::make_unique<char[]>(size);
         memcpy_s(ret.get(), size, s->data, s->length);
         retSize = s->length;
         return ret;
diff --git a/shared/source/ail/ail_configuration.h b/shared/source/ail/ail_configuration.h
index bac17d4d4644f..db760fd6cbe15 100644
--- a/shared/source/ail/ail_configuration.h
+++ b/shared/source/ail/ail_configuration.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021-2024 Intel Corporation
+ * Copyright (C) 2021-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -120,8 +120,7 @@ template <PRODUCT_FAMILY product>
 class AILConfigurationHw : public AILConfiguration {
   public:
     static std::unique_ptr<AILConfiguration> create() {
-        auto ailConfiguration = std::unique_ptr<AILConfiguration>(new AILConfigurationHw());
-        return ailConfiguration;
+        return std::make_unique<AILConfigurationHw>();
     }
 
     void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) override;
diff --git a/shared/source/built_ins/built_ins_storage.cpp b/shared/source/built_ins/built_ins_storage.cpp
index d44bb3f920ecf..63013d20231aa 100644
--- a/shared/source/built_ins/built_ins_storage.cpp
+++ b/shared/source/built_ins/built_ins_storage.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2024 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -173,8 +173,8 @@ BuiltinResourceT EmbeddedStorage::loadImpl(const std::string &fullResourceName)
 }
 
 BuiltinsLib::BuiltinsLib() {
-    allStorages.push_back(std::unique_ptr<Storage>(new EmbeddedStorage("")));
-    allStorages.push_back(std::unique_ptr<Storage>(new FileStorage(getDriverInstallationPath())));
+    allStorages.push_back(std::make_unique<EmbeddedStorage>(""));
+    allStorages.push_back(std::make_unique<FileStorage>(getDriverInstallationPath()));
 }
 
 BuiltinCode BuiltinsLib::getBuiltinCode(EBuiltInOps::Type builtin, BuiltinCode::ECodeType requestedCodeType, Device &device) {
diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp
index 3814dad31cb52..6a827da85521a 100644
--- a/shared/source/command_container/cmdcontainer.cpp
+++ b/shared/source/command_container/cmdcontainer.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2019-2024 Intel Corporation
+ * Copyright (C) 2019-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -120,7 +120,7 @@ CommandContainer::ErrorCode CommandContainer::initialize(Device *device, Allocat
 
     addToResidencyContainer(cmdBufferAllocation);
     if (requireHeaps) {
-        heapHelper = std::unique_ptr<HeapHelper>(new HeapHelper(device->getMemoryManager(), device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage(), device->getNumGenericSubDevices() > 1u));
+        heapHelper = std::make_unique<HeapHelper>(device->getMemoryManager(), device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage(), device->getNumGenericSubDevices() > 1u);
 
         for (uint32_t i = 0; i < IndirectHeap::Type::numTypes; i++) {
             auto heapType = static_cast<HeapType>(i);
diff --git a/shared/source/dll/create_deferred_deleter.cpp b/shared/source/dll/create_deferred_deleter.cpp
index b40ccf175cc50..70428f5ab613b 100644
--- a/shared/source/dll/create_deferred_deleter.cpp
+++ b/shared/source/dll/create_deferred_deleter.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2022 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -9,6 +9,6 @@
 
 namespace NEO {
 std::unique_ptr<DeferredDeleter> createDeferredDeleter() {
-    return std::unique_ptr<DeferredDeleter>(new DeferredDeleter());
+    return std::make_unique<DeferredDeleter>();
 }
 } // namespace NEO
diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp
index 52b40dade3557..1ed9e029a95b6 100644
--- a/shared/source/os_interface/linux/drm_memory_manager.cpp
+++ b/shared/source/os_interface/linux/drm_memory_manager.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2024 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -793,7 +793,7 @@ GraphicsAllocation *DrmMemoryManager::allocatePhysicalDeviceMemory(const Allocat
     auto isCoherent = productHelper.isCoherentAllocation(patIndex);
     uint32_t handle = ioctlHelper->createGem(bufferSize, static_cast<uint32_t>(allocationData.storageInfo.memoryBanks.to_ulong()), isCoherent);
 
-    std::unique_ptr<BufferObject, BufferObject::Deleter> bo(new BufferObject(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount));
+    auto bo = std::make_unique<BufferObject>(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount);
 
     auto allocation = new DrmAllocation(allocationData.rootDeviceIndex, 1u /*num gmms*/, allocationData.type, bo.get(), nullptr, 0u, bufferSize, memoryPool);
     allocation->setDefaultGmm(gmm.release());
@@ -842,7 +842,7 @@ GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD(const AllocationData &
         boType = BufferObject::BOType::legacy;
     }
 
-    std::unique_ptr<BufferObject, BufferObject::Deleter> bo(new BufferObject(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount));
+    auto bo = std::make_unique<BufferObject>(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount);
     bo->setAddress(gpuRange);
     bo->setBOType(boType);
 
@@ -2683,7 +2683,7 @@ GraphicsAllocation *DrmMemoryManager::createSharedUnifiedMemoryAllocation(const
             return nullptr;
         }
 
-        std::unique_ptr<BufferObject, BufferObject::Deleter> bo(new BufferObject(allocationData.rootDeviceIndex, &drm, patIndex, handle, currentSize, maxOsContextCount));
+        auto bo = std::make_unique<BufferObject>(allocationData.rootDeviceIndex, &drm, patIndex, handle, currentSize, maxOsContextCount);
 
         if (vmAdviseAttribute.has_value() && !ioctlHelper->setVmBoAdvise(bo->peekHandle(), vmAdviseAttribute.value(), nullptr)) {
             ioctlHelper->munmapFunction(*this, cpuBasePointer, totalSizeToAlloc);
diff --git a/shared/source/os_interface/linux/ioctl_helper_prelim.cpp b/shared/source/os_interface/linux/ioctl_helper_prelim.cpp
index b325a21c7b168..e190637fe8ee5 100644
--- a/shared/source/os_interface/linux/ioctl_helper_prelim.cpp
+++ b/shared/source/os_interface/linux/ioctl_helper_prelim.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021-2024 Intel Corporation
+ * Copyright (C) 2021-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -503,7 +503,7 @@ std::unique_ptr<uint8_t[]> IoctlHelperPrelim20::prepareVmBindExt(const StackVec<
                   "Alignment of a buffer returned via new[] operator must allow storing the required type!");
 
     const auto bufferSize{sizeof(prelim_drm_i915_vm_bind_ext_uuid) * bindExtHandles.size()};
-    std::unique_ptr<uint8_t[]> extensionsBuffer{new uint8_t[bufferSize]};
+    auto extensionsBuffer = std::make_unique<uint8_t[]>(bufferSize);
 
     auto extensions = new (extensionsBuffer.get()) prelim_drm_i915_vm_bind_ext_uuid[bindExtHandles.size()];
     std::memset(extensionsBuffer.get(), 0, bufferSize);
diff --git a/shared/source/os_interface/linux/os_thread_linux.cpp b/shared/source/os_interface/linux/os_thread_linux.cpp
index 15aaa01d0b9be..442da45cb5572 100644
--- a/shared/source/os_interface/linux/os_thread_linux.cpp
+++ b/shared/source/os_interface/linux/os_thread_linux.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020-2024 Intel Corporation
+ * Copyright (C) 2020-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -17,7 +17,7 @@ decltype(&Thread::create) Thread::createFunc = Thread::create;
 std::unique_ptr<Thread> Thread::create(void *(*func)(void *), void *arg) {
     pthread_t threadId;
     pthread_create(&threadId, nullptr, func, arg);
-    return std::unique_ptr<Thread>(new ThreadLinux(threadId));
+    return std::make_unique<ThreadLinux>(threadId);
 }
 
 void ThreadLinux::join() {
diff --git a/shared/source/os_interface/linux/os_time_linux.cpp b/shared/source/os_interface/linux/os_time_linux.cpp
index 0675ea5dbb992..c5fc4b4d6392e 100644
--- a/shared/source/os_interface/linux/os_time_linux.cpp
+++ b/shared/source/os_interface/linux/os_time_linux.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2024 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -72,7 +72,7 @@ uint64_t OSTimeLinux::getCpuRawTimestamp() {
 }
 
 std::unique_ptr<OSTime> OSTimeLinux::create(OSInterface &osInterface, std::unique_ptr<DeviceTime> deviceTime) {
-    return std::unique_ptr<OSTime>(new OSTimeLinux(osInterface, std::move(deviceTime)));
+    return std::make_unique<OSTimeLinux>(osInterface, std::move(deviceTime));
 }
 
 } // namespace NEO
diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp
index 2f3d8610b8638..d9d1d668dcc12 100644
--- a/shared/source/os_interface/windows/wddm/wddm.cpp
+++ b/shared/source/os_interface/windows/wddm/wddm.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2024 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -67,7 +67,7 @@ Wddm::Wddm(std::unique_ptr<HwDeviceIdWddm> &&hwDeviceIdIn, RootDeviceEnvironment
     memset(gtSystemInfo.get(), 0, sizeof(*gtSystemInfo));
     memset(gfxPlatform.get(), 0, sizeof(*gfxPlatform));
     this->enablePreemptionRegValue = NEO::readEnablePreemptionRegKey();
-    kmDafListener = std::unique_ptr<KmDafListener>(new KmDafListener);
+    kmDafListener = std::make_unique<KmDafListener>();
     temporaryResources = std::make_unique<WddmResidentAllocationsContainer>(this);
     osMemory = OSMemory::create();
     bool forceCheck = false;
@@ -864,10 +864,10 @@ bool Wddm::openSharedHandle(const MemoryManager::OsHandleData &osHandleData, Wdd
         return false;
     }
 
-    std::unique_ptr<char[]> allocPrivateData(new char[queryResourceInfo.TotalPrivateDriverDataSize]);
-    std::unique_ptr<char[]> resPrivateData(new char[queryResourceInfo.ResourcePrivateDriverDataSize]);
-    std::unique_ptr<char[]> resPrivateRuntimeData(new char[queryResourceInfo.PrivateRuntimeDataSize]);
-    std::unique_ptr<D3DDDI_OPENALLOCATIONINFO[]> allocationInfo(new D3DDDI_OPENALLOCATIONINFO[queryResourceInfo.NumAllocations]);
+    auto allocPrivateData = std::make_unique<char[]>(queryResourceInfo.TotalPrivateDriverDataSize);
+    auto resPrivateData = std::make_unique<char[]>(queryResourceInfo.ResourcePrivateDriverDataSize);
+    auto resPrivateRuntimeData = std::make_unique<char[]>(queryResourceInfo.PrivateRuntimeDataSize);
+    auto allocationInfo = std::make_unique<D3DDDI_OPENALLOCATIONINFO[]>(queryResourceInfo.NumAllocations);
 
     D3DKMT_OPENRESOURCE openResource = {};
 
@@ -914,10 +914,10 @@ bool Wddm::openNTHandle(const MemoryManager::OsHandleData &osHandleData, WddmAll
         return false;
     }
 
-    std::unique_ptr<char[]> allocPrivateData(new char[queryResourceInfoFromNtHandle.TotalPrivateDriverDataSize]);
-    std::unique_ptr<char[]> resPrivateData(new char[queryResourceInfoFromNtHandle.ResourcePrivateDriverDataSize]);
-    std::unique_ptr<char[]> resPrivateRuntimeData(new char[queryResourceInfoFromNtHandle.PrivateRuntimeDataSize]);
-    std::unique_ptr<D3DDDI_OPENALLOCATIONINFO2[]> allocationInfo2(new D3DDDI_OPENALLOCATIONINFO2[queryResourceInfoFromNtHandle.NumAllocations]);
+    auto allocPrivateData = std::make_unique<char>(queryResourceInfoFromNtHandle.TotalPrivateDriverDataSize);
+    auto resPrivateData = std::make_unique<char>(queryResourceInfoFromNtHandle.ResourcePrivateDriverDataSize);
+    auto resPrivateRuntimeData = std::make_unique<char>(queryResourceInfoFromNtHandle.PrivateRuntimeDataSize);
+    auto allocationInfo2 = std::make_unique<D3DDDI_OPENALLOCATIONINFO2[]>(queryResourceInfoFromNtHandle.NumAllocations);
 
     D3DKMT_OPENRESOURCEFROMNTHANDLE openResourceFromNtHandle = {};
 
diff --git a/shared/source/program/print_formatter.cpp b/shared/source/program/print_formatter.cpp
index 0535a480e4863..41f9ef36c6907 100644
--- a/shared/source/program/print_formatter.cpp
+++ b/shared/source/program/print_formatter.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2023 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -59,7 +59,7 @@ void PrintFormatter::printString(const char *formatString, const std::function<v
     size_t length = strnlen_s(formatString, maxSinglePrintStringLength - 1);
 
     size_t cursor = 0;
-    std::unique_ptr<char[]> dataFormat(new char[length + 1]);
+    auto dataFormat = std::make_unique<char[]>(length + 1);
 
     for (size_t i = 0; i <= length; i++) {
         if (formatString[i] == '\\')
diff --git a/shared/source/utilities/idlist.h b/shared/source/utilities/idlist.h
index bdab7e59de11a..e20c97b0e6a4f 100644
--- a/shared/source/utilities/idlist.h
+++ b/shared/source/utilities/idlist.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2023 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -463,7 +463,7 @@ template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = true
 class IDRefList : public IDList<IDNodeRef<NodeObjectType>, threadSafe, ownsNodes> {
   public:
     void pushRefFrontOne(NodeObjectType &node) {
-        auto refNode = std::unique_ptr<IDNodeRef<NodeObjectType>>(new IDNodeRef<NodeObjectType>(&node));
+        auto refNode = std::make_unique<IDNodeRef<NodeObjectType>>(&node);
         this->pushFrontOne(*refNode);
         refNode.release();
     }
diff --git a/shared/source/utilities/iflist.h b/shared/source/utilities/iflist.h
index 314daa1b5a083..b0d0cca2adc7b 100644
--- a/shared/source/utilities/iflist.h
+++ b/shared/source/utilities/iflist.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2023 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -189,7 +189,7 @@ template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = true
 class IFRefList : public IFList<IFNodeRef<NodeObjectType>, threadSafe, ownsNodes> {
   public:
     void pushRefFrontOne(NodeObjectType &node) {
-        auto up = std::unique_ptr<IFNodeRef<NodeObjectType>>(new IFNodeRef<NodeObjectType>(&node));
+        auto up = std::make_unique<IFNodeRef<NodeObjectType>>(&node);
         this->pushFrontOne(*up);
         up.release();
     } // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
diff --git a/shared/source/utilities/perf_profiler.cpp b/shared/source/utilities/perf_profiler.cpp
index a8d57bf7fc641..bdc08d20d629e 100644
--- a/shared/source/utilities/perf_profiler.cpp
+++ b/shared/source/utilities/perf_profiler.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2023 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  *
  * SPDX-License-Identifier: MIT
  *
@@ -29,8 +29,8 @@ PerfProfiler *PerfProfiler::create(bool dumpToFile) {
     if (gPerfProfiler == nullptr) {
         int old = counter.fetch_add(1);
         if (!dumpToFile) {
-            std::unique_ptr<std::stringstream> logs = std::unique_ptr<std::stringstream>(new std::stringstream());
-            std::unique_ptr<std::stringstream> sysLogs = std::unique_ptr<std::stringstream>(new std::stringstream());
+            auto logs = std::make_unique<std::stringstream>();
+            auto sysLogs = std::make_unique<std::stringstream>();
             gPerfProfiler = new PerfProfiler(old, std::move(logs), std::move(sysLogs));
         } else {
             gPerfProfiler = new PerfProfiler(old);
@@ -63,7 +63,7 @@ PerfProfiler::PerfProfiler(int id, std::unique_ptr<std::ostream> &&logOut, std::
         std::stringstream filename;
         filename << "PerfReport_Thread_" << id << ".xml";
 
-        std::unique_ptr<std::ofstream> logToFile = std::unique_ptr<std::ofstream>(new std::ofstream());
+        auto logToFile = std::make_unique<std::ofstream>();
         logToFile->exceptions(std::ios::failbit | std::ios::badbit);
         logToFile->open(filename.str().c_str(), std::ios::trunc);
         this->logFile = std::move(logToFile);
@@ -77,7 +77,7 @@ PerfProfiler::PerfProfiler(int id, std::unique_ptr<std::ostream> &&logOut, std::
         std::stringstream filename;
         filename << "SysPerfReport_Thread_" << id << ".xml";
 
-        std::unique_ptr<std::ofstream> sysLogToFile = std::unique_ptr<std::ofstream>(new std::ofstream());
+        auto sysLogToFile = std::make_unique<std::ofstream>();
         sysLogToFile->exceptions(std::ios::failbit | std::ios::badbit);
         sysLogToFile->open(filename.str().c_str(), std::ios::trunc);
         this->sysLogFile = std::move(sysLogToFile);