forked from OSchip/llvm-project
[XRay] Account for virtual memory re-use
Change the assumption when releasing memory to a buffer queue that new generations might not be able to re-use the memory mapped addresses. llvm-svn: 344882
This commit is contained in:
parent
788b17ca78
commit
2336dc3c51
|
@ -124,13 +124,11 @@ BufferQueue::ErrorCode BufferQueue::releaseBuffer(Buffer &Buf) {
|
|||
return BufferQueue::ErrorCode::UnrecognizedBuffer;
|
||||
}
|
||||
|
||||
// This points to a semantic bug, we really ought to not be releasing more
|
||||
// buffers than we actually get.
|
||||
if (LiveBuffers == 0) {
|
||||
Buf.Data = nullptr;
|
||||
Buf.Size = Buf.Size;
|
||||
Buf.Generation = 0;
|
||||
return ErrorCode::NotEnoughMemory;
|
||||
return ErrorCode::Ok;
|
||||
}
|
||||
|
||||
--LiveBuffers;
|
||||
|
|
Loading…
Reference in New Issue