SWDEV-532479 - Add tracking of hostcall memory allocations (#416)
* SWDEV-532479 - Add tracking of hostcall memory allocations * SWDEV-532479 - Remove hostcall allocations if request is received * SWDEV-532479 - Cleanup * SWDEV-532479 - Naming fix * SWDEV-532479 - Add new separator after each new function
This commit is contained in:
committed by
GitHub
parent
5f86622adc
commit
b58faa2f37
@@ -94,6 +94,7 @@ static void handlePayload(MessageHandler& messages, uint32_t service, uint64_t*
|
||||
if (payload[0]) {
|
||||
amd::Memory* mem = amd::MemObjMap::FindMemObj(reinterpret_cast<void*>(payload[0]));
|
||||
if (mem) {
|
||||
const_cast<amd::Device*>(&dev)->RemoveHostcallMemory(mem);
|
||||
amd::MemObjMap::RemoveMemObj(reinterpret_cast<void*>(payload[0]));
|
||||
mem->release();
|
||||
} else {
|
||||
@@ -110,6 +111,7 @@ static void handlePayload(MessageHandler& messages, uint32_t service, uint64_t*
|
||||
device::Memory* dm = buf->getDeviceMemory(dev);
|
||||
va = dm->virtualAddress();
|
||||
amd::MemObjMap::AddMemObj(reinterpret_cast<void*>(va), buf);
|
||||
const_cast<amd::Device*>(&dev)->TrackHostcallMemory(buf);
|
||||
} else {
|
||||
buf->release();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user