util/HugeAllocator: throw std::bad_alloc on error
This commit is contained in:
@@ -50,10 +50,7 @@ ThreadInputStream::Start(Error &error)
|
||||
assert(buffer == nullptr);
|
||||
|
||||
void *p = HugeAllocate(buffer_size);
|
||||
if (p == nullptr) {
|
||||
error.SetErrno();
|
||||
return nullptr;
|
||||
}
|
||||
assert(p != nullptr);
|
||||
|
||||
buffer = new CircularBuffer<uint8_t>((uint8_t *)p, buffer_size);
|
||||
|
||||
|
Reference in New Issue
Block a user