Skip to content

Commit b737ed5

Browse files
Fix for heapHelper
-add mockable_virtual for memoryManager class Change-Id: Ie3ff592c7d61759efa7c2955de6b4e8d1731a2c4
1 parent 9f5152e commit b737ed5

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

core/helpers/heap_helper.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ GraphicsAllocation *HeapHelper::getHeapAllocation(size_t heapSize, size_t alignm
1717
if (allocation) {
1818
return allocation.release();
1919
}
20-
NEO::AllocationProperties properties{rootDeviceIndex,
21-
true /* allocateMemory*/,
22-
alignment,
23-
GraphicsAllocation::AllocationType::INTERNAL_HEAP,
24-
isMultiOsContextCapable,
25-
false /* isMultiStorageAllocation */,
26-
{}};
20+
NEO::AllocationProperties properties{rootDeviceIndex, true, heapSize, GraphicsAllocation::AllocationType::INTERNAL_HEAP, isMultiOsContextCapable, false, {}};
21+
properties.alignment = alignment;
2722

2823
return this->memManager->allocateGraphicsMemoryWithProperties(properties);
2924
}

runtime/memory_manager/memory_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class MemoryManager {
6969
return allocateGraphicsMemoryInPreferredPool(properties, ptr);
7070
}
7171

72-
GraphicsAllocation *allocateGraphicsMemoryInPreferredPool(const AllocationProperties &properties, const void *hostPtr);
72+
MOCKABLE_VIRTUAL GraphicsAllocation *allocateGraphicsMemoryInPreferredPool(const AllocationProperties &properties, const void *hostPtr);
7373

7474
virtual GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) = 0;
7575

@@ -90,7 +90,7 @@ class MemoryManager {
9090
void freeSystemMemory(void *ptr);
9191

9292
virtual void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) = 0;
93-
void freeGraphicsMemory(GraphicsAllocation *gfxAllocation);
93+
MOCKABLE_VIRTUAL void freeGraphicsMemory(GraphicsAllocation *gfxAllocation);
9494
virtual void handleFenceCompletion(GraphicsAllocation *allocation){};
9595

9696
void checkGpuUsageAndDestroyGraphicsAllocations(GraphicsAllocation *gfxAllocation);

0 commit comments

Comments
 (0)