mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Don't copy memory to allocation if allocation has no storage
Change-Id: I3238bec02e5c1ec5877537318bb563e3d0f3799d Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
74f1896c03
commit
c0325b5d19
@@ -406,7 +406,7 @@ HeapIndex MemoryManager::selectHeap(const GraphicsAllocation *allocation, const
|
||||
return HeapIndex::HEAP_LIMITED;
|
||||
}
|
||||
bool MemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAllocation, const void *memoryToCopy, uint32_t sizeToCopy) const {
|
||||
if (!graphicsAllocation || !memoryToCopy || sizeToCopy == 0u) {
|
||||
if (!graphicsAllocation->getUnderlyingBuffer()) {
|
||||
return false;
|
||||
}
|
||||
memcpy_s(graphicsAllocation->getUnderlyingBuffer(), graphicsAllocation->getUnderlyingBufferSize(), memoryToCopy, sizeToCopy);
|
||||
|
||||
Reference in New Issue
Block a user