mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 03:20:47 +08:00
[Sysman] Replace normal pointers with smart pointers (11/n)
Replacing normal pointers by smart pointers in memory module of LO sysman(zesinit). Related-To: LOCI-2810 Signed-off-by: Singh, Prasoon <prasoon.singh@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d1393e08d3
commit
afe99d7dbc
@@ -14,18 +14,12 @@
|
||||
namespace L0 {
|
||||
namespace Sysman {
|
||||
|
||||
MemoryHandleContext::~MemoryHandleContext() {
|
||||
for (Memory *pMemory : handleList) {
|
||||
delete pMemory;
|
||||
}
|
||||
}
|
||||
MemoryHandleContext::~MemoryHandleContext() = default;
|
||||
|
||||
void MemoryHandleContext::createHandle(bool onSubdevice, uint32_t subDeviceId) {
|
||||
Memory *pMemory = new MemoryImp(pOsSysman, onSubdevice, subDeviceId);
|
||||
std::unique_ptr<Memory> pMemory = std::make_unique<MemoryImp>(pOsSysman, onSubdevice, subDeviceId);
|
||||
if (pMemory->initSuccess == true) {
|
||||
handleList.push_back(pMemory);
|
||||
} else {
|
||||
delete pMemory;
|
||||
handleList.push_back(std::move(pMemory));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user