mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Correct handling unique_ptr in functions
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f305e38b32
commit
28b37aea72
@@ -18,7 +18,7 @@ InternalAllocationStorage::InternalAllocationStorage(CommandStreamReceiver &comm
|
||||
temporaryAllocations(TEMPORARY_ALLOCATION),
|
||||
allocationsForReuse(REUSABLE_ALLOCATION){};
|
||||
|
||||
void InternalAllocationStorage::storeAllocation(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage) {
|
||||
void InternalAllocationStorage::storeAllocation(std::unique_ptr<GraphicsAllocation> &&gfxAllocation, uint32_t allocationUsage) {
|
||||
uint32_t taskCount = gfxAllocation->getTaskCount(commandStreamReceiver.getOsContext().getContextId());
|
||||
|
||||
if (allocationUsage == REUSABLE_ALLOCATION) {
|
||||
@@ -27,7 +27,7 @@ void InternalAllocationStorage::storeAllocation(std::unique_ptr<GraphicsAllocati
|
||||
|
||||
storeAllocationWithTaskCount(std::move(gfxAllocation), allocationUsage, taskCount);
|
||||
}
|
||||
void InternalAllocationStorage::storeAllocationWithTaskCount(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage, uint32_t taskCount) {
|
||||
void InternalAllocationStorage::storeAllocationWithTaskCount(std::unique_ptr<GraphicsAllocation> &&gfxAllocation, uint32_t allocationUsage, uint32_t taskCount) {
|
||||
if (allocationUsage == REUSABLE_ALLOCATION) {
|
||||
if (DebugManager.flags.DisableResourceRecycling.get()) {
|
||||
commandStreamReceiver.getMemoryManager()->freeGraphicsMemory(gfxAllocation.release());
|
||||
|
||||
@@ -16,8 +16,8 @@ class InternalAllocationStorage {
|
||||
MOCKABLE_VIRTUAL ~InternalAllocationStorage() = default;
|
||||
InternalAllocationStorage(CommandStreamReceiver &commandStreamReceiver);
|
||||
MOCKABLE_VIRTUAL void cleanAllocationList(uint32_t waitTaskCount, uint32_t allocationUsage);
|
||||
void storeAllocation(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage);
|
||||
void storeAllocationWithTaskCount(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage, uint32_t taskCount);
|
||||
void storeAllocation(std::unique_ptr<GraphicsAllocation> &&gfxAllocation, uint32_t allocationUsage);
|
||||
void storeAllocationWithTaskCount(std::unique_ptr<GraphicsAllocation> &&gfxAllocation, uint32_t allocationUsage, uint32_t taskCount);
|
||||
std::unique_ptr<GraphicsAllocation> obtainReusableAllocation(size_t requiredSize, GraphicsAllocation::AllocationType allocationType);
|
||||
std::unique_ptr<GraphicsAllocation> obtainTemporaryAllocationWithPtr(size_t requiredSize, const void *requiredPtr, GraphicsAllocation::AllocationType allocationType);
|
||||
AllocationsList &getTemporaryAllocations() { return temporaryAllocations; }
|
||||
|
||||
Reference in New Issue
Block a user