mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Rename Bitmap::try_create() to ::create()
This is step 1 to removing `must_create()`.
This commit is contained in:
parent
c4e8509aac
commit
bed5961fc2
Notes:
sideshowbarker
2024-07-17 05:13:53 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/bed5961fc2 Pull-request: https://github.com/SerenityOS/serenity/pull/16605
5 changed files with 8 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {};
|
||||
}
|
||||
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue