Added assert for host buffer allocation. (flutter/engine#55395)

fixes https://github.com/flutter/flutter/issues/155555

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
gaaclarke
2024-09-24 10:33:36 -07:00
committed by GitHub
parent d14216802d
commit fe5be148d8

View File

@@ -29,7 +29,9 @@ HostBuffer::HostBuffer(const std::shared_ptr<Allocator>& allocator)
desc.size = kAllocatorBlockSize;
desc.storage_mode = StorageMode::kHostVisible;
for (auto i = 0u; i < kHostBufferArenaSize; i++) {
device_buffers_[i].push_back(allocator->CreateBuffer(desc));
std::shared_ptr<DeviceBuffer> device_buffer = allocator->CreateBuffer(desc);
FML_CHECK(device_buffer) << "Failed to allocate device buffer.";
device_buffers_[i].push_back(device_buffer);
}
}