瀏覽代碼

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.
Andreas Kling 5 年之前
父節點
當前提交
a70cc5ca1d
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Kernel/KBuffer.h

+ 1 - 0
Kernel/KBuffer.h

@@ -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;
     }
     }