mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:37:36 +00:00
Kernel: Use TRY() in AnonymousVMObject
This commit is contained in:
parent
abb43468dc
commit
3631ebe963
1 changed files with 1 additions and 5 deletions
|
@ -21,11 +21,7 @@ KResultOr<NonnullRefPtr<VMObject>> AnonymousVMObject::try_clone()
|
||||||
if (is_purgeable() && is_volatile()) {
|
if (is_purgeable() && is_volatile()) {
|
||||||
// If this object is purgeable+volatile, create a new zero-filled purgeable+volatile
|
// If this object is purgeable+volatile, create a new zero-filled purgeable+volatile
|
||||||
// object, effectively "pre-purging" it in the child process.
|
// object, effectively "pre-purging" it in the child process.
|
||||||
auto maybe_clone = try_create_purgeable_with_size(size(), AllocationStrategy::None);
|
auto clone = TRY(try_create_purgeable_with_size(size(), AllocationStrategy::None));
|
||||||
if (maybe_clone.is_error())
|
|
||||||
return maybe_clone.error();
|
|
||||||
|
|
||||||
auto clone = maybe_clone.release_value();
|
|
||||||
clone->m_volatile = true;
|
clone->m_volatile = true;
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue