Add checks for mmap and getSpace

Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
John Falkowski
2022-02-28 17:12:41 +00:00
committed by Compute-Runtime-Automation
parent 090bfb9642
commit 22ed1be1a3
2 changed files with 12 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ inline void *LinearStream::getSpace(size_t size) {
cmdContainer->closeAndAllocateNextCommandBuffer();
}
UNRECOVERABLE_IF(sizeUsed + size > maxAvailableSpace);
UNRECOVERABLE_IF(reinterpret_cast<int64_t>(buffer) <= 0);
auto memory = ptrOffset(buffer, sizeUsed);
sizeUsed += size;
return memory;