Remove O(n) lookup in command container destructor

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2022-10-14 12:28:13 +00:00
committed by Compute-Runtime-Automation
parent f4c40c74cb
commit 647321af6f
2 changed files with 2 additions and 17 deletions

View File

@@ -254,9 +254,8 @@ void CommandContainer::handleCmdBufferAllocations(size_t startIndex) {
if (isHandleFenceCompletionRequired) {
this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]);
}
if (!this->reusableAllocationList->peekContains(*cmdBufferAllocations[i])) {
reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]);
}
reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]);
} else {
this->device->getMemoryManager()->freeGraphicsMemory(cmdBufferAllocations[i]);
}