1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:38:10 +00:00

Kernel: Move allocate_unbacked_region_anywhere() to MemoryManager

This didn't need to be in RegionTree, and since it's specific to kernel
VM anyway, let's move it to MemoryManager.
This commit is contained in:
Andreas Kling 2022-04-05 12:40:31 +02:00
parent e0da8da657
commit f8d798b667
5 changed files with 9 additions and 10 deletions

View file

@ -1242,4 +1242,11 @@ ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::create_identity_mapped_reg
return region;
}
ErrorOr<NonnullOwnPtr<Region>> MemoryManager::allocate_unbacked_region_anywhere(size_t size, size_t alignment)
{
auto region = TRY(Region::create_unbacked());
TRY(m_region_tree.place_anywhere(*region, RandomizeVirtualAddress::No, size, alignment));
return region;
}
}