AK: Rename Bitmap::try_create() to ::create()

This is step 1 to removing `must_create()`.
This commit is contained in:
Sam Atkins 2022-12-20 16:34:13 +00:00 committed by Andreas Kling
parent c4e8509aac
commit bed5961fc2
Notes: sideshowbarker 2024-07-17 05:13:53 +09:00
5 changed files with 8 additions and 8 deletions

View file

@ -22,7 +22,7 @@ class Bitmap : public BitmapView {
AK_MAKE_NONCOPYABLE(Bitmap);
public:
static ErrorOr<Bitmap> try_create(size_t size, bool default_value)
static ErrorOr<Bitmap> create(size_t size, bool default_value)
{
VERIFY(size != 0);
@ -37,7 +37,7 @@ public:
static Bitmap must_create(size_t size, bool default_value)
{
return MUST(try_create(size, default_value));
return MUST(create(size, default_value));
}
Bitmap() = default;

View file

@ -14,7 +14,7 @@ namespace Kernel::PCI {
HostController::HostController(PCI::Domain const& domain)
: m_domain(domain)
, m_enumerated_buses(Bitmap::try_create(256, false).release_value_but_fixme_should_propagate_errors())
, m_enumerated_buses(Bitmap::create(256, false).release_value_but_fixme_should_propagate_errors())
{
}

View file

@ -279,7 +279,7 @@ NonnullRefPtr<PhysicalPage> AnonymousVMObject::allocate_committed_page(Badge<Reg
ErrorOr<void> AnonymousVMObject::ensure_cow_map()
{
if (m_cow_map.is_null())
m_cow_map = TRY(Bitmap::try_create(page_count(), true));
m_cow_map = TRY(Bitmap::create(page_count(), true));
return {};
}

View file

@ -23,14 +23,14 @@ ErrorOr<NonnullLockRefPtr<PrivateInodeVMObject>> PrivateInodeVMObject::try_creat
auto size = max(inode.size(), (offset + range_size));
VERIFY(size > 0);
auto new_physical_pages = TRY(VMObject::try_create_physical_pages(size));
auto dirty_pages = TRY(Bitmap::try_create(new_physical_pages.size(), false));
auto dirty_pages = TRY(Bitmap::create(new_physical_pages.size(), false));
return adopt_nonnull_lock_ref_or_enomem(new (nothrow) PrivateInodeVMObject(inode, move(new_physical_pages), move(dirty_pages)));
}
ErrorOr<NonnullLockRefPtr<VMObject>> PrivateInodeVMObject::try_clone()
{
auto new_physical_pages = TRY(this->try_clone_physical_pages());
auto dirty_pages = TRY(Bitmap::try_create(new_physical_pages.size(), false));
auto dirty_pages = TRY(Bitmap::create(new_physical_pages.size(), false));
return adopt_nonnull_lock_ref_or_enomem<VMObject>(new (nothrow) PrivateInodeVMObject(*this, move(new_physical_pages), move(dirty_pages)));
}

View file

@ -26,7 +26,7 @@ ErrorOr<NonnullLockRefPtr<SharedInodeVMObject>> SharedInodeVMObject::try_create_
if (auto shared_vmobject = inode.shared_vmobject())
return shared_vmobject.release_nonnull();
auto new_physical_pages = TRY(VMObject::try_create_physical_pages(size));
auto dirty_pages = TRY(Bitmap::try_create(new_physical_pages.size(), false));
auto dirty_pages = TRY(Bitmap::create(new_physical_pages.size(), false));
auto vmobject = TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) SharedInodeVMObject(inode, move(new_physical_pages), move(dirty_pages))));
TRY(vmobject->inode().set_shared_vmobject(*vmobject));
return vmobject;
@ -35,7 +35,7 @@ ErrorOr<NonnullLockRefPtr<SharedInodeVMObject>> SharedInodeVMObject::try_create_
ErrorOr<NonnullLockRefPtr<VMObject>> SharedInodeVMObject::try_clone()
{
auto new_physical_pages = TRY(this->try_clone_physical_pages());
auto dirty_pages = TRY(Bitmap::try_create(new_physical_pages.size(), false));
auto dirty_pages = TRY(Bitmap::create(new_physical_pages.size(), false));
return adopt_nonnull_lock_ref_or_enomem<VMObject>(new (nothrow) SharedInodeVMObject(*this, move(new_physical_pages), move(dirty_pages)));
}