mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
Kernel: Make KBuffer lazily populated
KBuffers are now zero-filled on demand instead of up front. This means that you can create a huge KBuffer and it will only take up VM, not physical pages (until you access them.)
This commit is contained in:
parent
a0bb592b4f
commit
c973a51a23
3 changed files with 5 additions and 4 deletions
|
@ -19,7 +19,7 @@ class KBufferImpl : public RefCounted<KBufferImpl> {
|
|||
public:
|
||||
static NonnullRefPtr<KBufferImpl> create_with_size(size_t size)
|
||||
{
|
||||
auto region = MM.allocate_kernel_region(PAGE_ROUND_UP(size), "KBuffer");
|
||||
auto region = MM.allocate_kernel_region(PAGE_ROUND_UP(size), "KBuffer", false, false);
|
||||
ASSERT(region);
|
||||
return adopt(*new KBufferImpl(*region, size));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue