1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

Kernel: Use default constructors/destructors

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
This commit is contained in:
Lenny Maiorani 2022-03-16 13:15:15 -06:00 committed by Brian Gianforcaro
parent 68f75ab98e
commit 190cf1507b
79 changed files with 102 additions and 309 deletions

View file

@ -29,9 +29,7 @@ AddressSpace::AddressSpace(NonnullRefPtr<PageDirectory> page_directory)
{
}
AddressSpace::~AddressSpace()
{
}
AddressSpace::~AddressSpace() = default;
ErrorOr<void> AddressSpace::unmap_mmap_range(VirtualAddress addr, size_t size)
{

View file

@ -166,9 +166,7 @@ AnonymousVMObject::AnonymousVMObject(AnonymousVMObject const& other, NonnullRefP
{
}
AnonymousVMObject::~AnonymousVMObject()
{
}
AnonymousVMObject::~AnonymousVMObject() = default;
size_t AnonymousVMObject::purge()
{
@ -370,9 +368,7 @@ AnonymousVMObject::SharedCommittedCowPages::SharedCommittedCowPages(CommittedPhy
{
}
AnonymousVMObject::SharedCommittedCowPages::~SharedCommittedCowPages()
{
}
AnonymousVMObject::SharedCommittedCowPages::~SharedCommittedCowPages() = default;
NonnullRefPtr<PhysicalPage> AnonymousVMObject::SharedCommittedCowPages::take_one()
{

View file

@ -25,9 +25,7 @@ InodeVMObject::InodeVMObject(InodeVMObject const& other, FixedArray<RefPtr<Physi
m_dirty_pages.set(i, other.m_dirty_pages.get(i));
}
InodeVMObject::~InodeVMObject()
{
}
InodeVMObject::~InodeVMObject() = default;
size_t InodeVMObject::amount_clean() const
{

View file

@ -94,9 +94,7 @@ UNMAP_AFTER_INIT MemoryManager::MemoryManager()
m_lazy_committed_page = committed_pages.take_one();
}
UNMAP_AFTER_INIT MemoryManager::~MemoryManager()
{
}
UNMAP_AFTER_INIT MemoryManager::~MemoryManager() = default;
UNMAP_AFTER_INIT void MemoryManager::protect_kernel_image()
{

View file

@ -123,9 +123,7 @@ ErrorOr<NonnullRefPtr<PageDirectory>> PageDirectory::try_create_for_userspace(Vi
return directory;
}
PageDirectory::PageDirectory()
{
}
PageDirectory::PageDirectory() = default;
UNMAP_AFTER_INIT void PageDirectory::allocate_kernel_directory()
{

View file

@ -27,9 +27,7 @@ static constexpr u32 next_power_of_two(u32 value)
return value;
}
PhysicalRegion::~PhysicalRegion()
{
}
PhysicalRegion::~PhysicalRegion() = default;
PhysicalRegion::PhysicalRegion(PhysicalAddress lower, PhysicalAddress upper)
: m_lower(lower)

View file

@ -33,8 +33,6 @@ PrivateInodeVMObject::PrivateInodeVMObject(PrivateInodeVMObject const& other, Fi
{
}
PrivateInodeVMObject::~PrivateInodeVMObject()
{
}
PrivateInodeVMObject::~PrivateInodeVMObject() = default;
}