util/HugeAllocator: HugeAllocator() returns WritableBuffer<void>

This commit is contained in:
Max Kellermann
2017-09-21 20:31:03 +02:00
parent 3e5ce3c92c
commit b46835e15e
4 changed files with 32 additions and 30 deletions

View File

@@ -50,12 +50,13 @@ ThreadInputStream::Start()
{
assert(buffer == nullptr);
void *p = HugeAllocate(buffer_size);
assert(p != nullptr);
auto allocation = HugeAllocate(buffer_size);
assert(allocation != nullptr);
HugeForkCow(p, buffer_size, false);
HugeForkCow(allocation.data, allocation.size, false);
buffer = new CircularBuffer<uint8_t>((uint8_t *)p, buffer_size);
buffer = new CircularBuffer<uint8_t>((uint8_t *)allocation.data,
allocation.size);
thread.Start();
}