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
Notes:
sideshowbarker
2024-07-19 09:09:00 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a70cc5ca1dc
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)
|
||||
{
|
||||
auto buffer = create_with_size(size, access, name);
|
||||
buffer->region().commit();
|
||||
memcpy(buffer->data(), data, size);
|
||||
return buffer;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue