mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
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:
parent
428582e805
commit
a70cc5ca1d
1 changed files with 1 additions and 0 deletions
|
@ -56,6 +56,7 @@ public:
|
||||||
static NonnullRefPtr<KBufferImpl> copy(const void* data, size_t size, u8 access, const char* name)
|
static NonnullRefPtr<KBufferImpl> copy(const void* data, size_t size, u8 access, const char* name)
|
||||||
{
|
{
|
||||||
auto buffer = create_with_size(size, access, name);
|
auto buffer = create_with_size(size, access, name);
|
||||||
|
buffer->region().commit();
|
||||||
memcpy(buffer->data(), data, size);
|
memcpy(buffer->data(), data, size);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue