SWDEV-430116 - Fix segfault in Heap::EraseAllocaton

Change-Id: I8c49af081079307118562485cb0d5b3e8a9d906a


[ROCm/clr commit: bc2a4f8450]
이 커밋은 다음에 포함됨:
Ioannis Assiouras가 2023-11-07 09:49:35 -05:00를 커밋했습니다
1 부모 8ea61ce28e
커밋 9d1a39bba2
1 파일이 변경됨
+1 -1
+1 -1
파일 보기
@@ -86,8 +86,8 @@ bool Heap::RemoveMemory(amd::Memory* memory, MemoryTimestamp* ts) {
std::unordered_map<amd::Memory*, MemoryTimestamp>::iterator
Heap::EraseAllocaton(std::unordered_map<amd::Memory*, MemoryTimestamp>::iterator& it) {
const device::Memory* dev_mem = it->first->getDeviceMemory(*device_->devices()[0]);
amd::SvmBuffer::free(it->first->getContext(), reinterpret_cast<void*>(dev_mem->virtualAddress()));
total_size_ -= it->first->getSize();
amd::SvmBuffer::free(it->first->getContext(), reinterpret_cast<void*>(dev_mem->virtualAddress()));
// Clear HIP event
it->second.SetEvent(nullptr);
// Remove the allocation from the map