Do not discard fragment allocator blocks multiple times.
discardBlock may be called multiple times on the same block.
We must not discard the block multiple times or we will corrupt
in-use memory accounting.
Change-Id: Ife9f3162785965a795dcf81887d4d447cc096e62
[ROCm/ROCR-Runtime commit: b9a0c1d313]
This commit is contained in:
@@ -300,6 +300,9 @@ template <typename Allocator> class SimpleHeap {
|
|||||||
(frag_map.rbegin()->first + frag_map.rbegin()->second.size <= base))
|
(frag_map.rbegin()->first + frag_map.rbegin()->second.size <= base))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Is block already discarded?
|
||||||
|
if (frag_map.begin()->second.discard) return true;
|
||||||
|
|
||||||
// Mark all fragments for discard and compute block size. Removes freelist records for all
|
// Mark all fragments for discard and compute block size. Removes freelist records for all
|
||||||
// fragments in the block.
|
// fragments in the block.
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user