summaryrefslogtreecommitdiff
path: root/Kernel/KBuffer.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-23 09:28:31 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-23 11:10:52 +0100
commita70cc5ca1dc6ae0c64e734c0f234c75ab8a184dc (patch)
tree147547cb281a54c304c254058148ad56ea281a2f /Kernel/KBuffer.h
parent428582e805a28a9d1a08828443c95d432a3c9349 (diff)
downloadserenity-a70cc5ca1dc6ae0c64e734c0f234c75ab8a184dc.zip
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.
Diffstat (limited to 'Kernel/KBuffer.h')
-rw-r--r--Kernel/KBuffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/KBuffer.h b/Kernel/KBuffer.h
index 0b529b821e..dd39544e06 100644
--- a/Kernel/KBuffer.h
+++ b/Kernel/KBuffer.h
@@ -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;
}