util/HugeAllocator: throw std::bad_alloc on error

This commit is contained in:
Max Kellermann
2016-06-17 17:44:45 +02:00
parent 35faafb32c
commit ef053035d0
7 changed files with 39 additions and 54 deletions

View File

@@ -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);