diff options
Diffstat (limited to 'compiler-rt/lib/scudo/standalone/secondary.cpp')
| -rw-r--r-- | compiler-rt/lib/scudo/standalone/secondary.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/compiler-rt/lib/scudo/standalone/secondary.cpp b/compiler-rt/lib/scudo/standalone/secondary.cpp index db7361d7134..dbf15892836 100644 --- a/compiler-rt/lib/scudo/standalone/secondary.cpp +++ b/compiler-rt/lib/scudo/standalone/secondary.cpp @@ -73,11 +73,7 @@ void *MapAllocator::allocate(uptr Size, uptr AlignmentHint, uptr *BlockEnd) { H->Data = Data; { ScopedLock L(Mutex); - if (LIKELY(Tail)) { - Tail->Next = H; - H->Prev = Tail; - } - Tail = H; + InUseBlocks.push_back(H); AllocatedBytes += CommitSize; if (LargestSize < CommitSize) LargestSize = CommitSize; @@ -94,22 +90,7 @@ void MapAllocator::deallocate(void *Ptr) { LargeBlock::Header *H = LargeBlock::getHeader(Ptr); { ScopedLock L(Mutex); - LargeBlock::Header *Prev = H->Prev; - LargeBlock::Header *Next = H->Next; - if (Prev) { - CHECK_EQ(Prev->Next, H); - Prev->Next = Next; - } - if (Next) { - CHECK_EQ(Next->Prev, H); - Next->Prev = Prev; - } - if (UNLIKELY(Tail == H)) { - CHECK(!Next); - Tail = Prev; - } else { - CHECK(Next); - } + InUseBlocks.remove(H); const uptr CommitSize = H->BlockEnd - reinterpret_cast<uptr>(H); FreedBytes += CommitSize; NumberOfFrees++; |

