mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
Kernel: Remove some Region construction helpers
It's now up to the caller to provide a VMObject when constructing a new Region object. This will make it easier to handle things going wrong, like allocation failures, etc.
This commit is contained in:
parent
fddc3c957b
commit
88b334135b
4 changed files with 5 additions and 30 deletions
|
@ -190,7 +190,8 @@ Region& Process::allocate_split_region(const Region& source_region, const Range&
|
|||
Region* Process::allocate_region(const Range& range, const String& name, int prot, bool commit)
|
||||
{
|
||||
ASSERT(range.is_valid());
|
||||
auto& region = add_region(Region::create_user_accessible(range, name, prot_to_region_access_flags(prot)));
|
||||
auto vmobject = AnonymousVMObject::create_with_size(range.size());
|
||||
auto& region = add_region(Region::create_user_accessible(range, vmobject, 0, name, prot_to_region_access_flags(prot)));
|
||||
region.map(page_directory());
|
||||
if (commit)
|
||||
region.commit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue