diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-23 09:28:31 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-23 11:10:52 +0100 |
commit | a70cc5ca1dc6ae0c64e734c0f234c75ab8a184dc (patch) | |
tree | 147547cb281a54c304c254058148ad56ea281a2f /Kernel/KBuffer.h | |
parent | 428582e805a28a9d1a08828443c95d432a3c9349 (diff) | |
download | serenity-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.h | 1 |
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; } |