Kernel: Commit the entire region up front in KBuffer::copy()

Since we know exactly how much physical memory we'll need, we might as
well commit it up front instead of letting page faults drive it.
This commit is contained in:
Andreas Kling 2020-02-23 09:28:31 +01:00
parent 428582e805
commit a70cc5ca1d
Notes: sideshowbarker 2024-07-19 09:09:00 +09:00

View file

@ -56,6 +56,7 @@ public:
static NonnullRefPtr<KBufferImpl> copy(const void* data, size_t size, u8 access, const char* name)
{
auto buffer = create_with_size(size, access, name);
buffer->region().commit();
memcpy(buffer->data(), data, size);
return buffer;
}