diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-14 23:53:47 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-15 01:48:09 +0200 |
commit | d4c73daacb9cda9660fbdb9ce5c974be32eb3a44 (patch) | |
tree | e73575e397ee8a14d180980e66d6ccb2577ee36d /Kernel | |
parent | d60f6176444f0e29681bf55c64e83b8353fd5437 (diff) | |
download | serenity-d4c73daacb9cda9660fbdb9ce5c974be32eb3a44.zip |
Kernel: Convert RangeAllocator to east-const style
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/VM/RangeAllocator.cpp | 6 | ||||
-rw-r--r-- | Kernel/VM/RangeAllocator.h | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Kernel/VM/RangeAllocator.cpp b/Kernel/VM/RangeAllocator.cpp index 991de83198..fc136f12ac 100644 --- a/Kernel/VM/RangeAllocator.cpp +++ b/Kernel/VM/RangeAllocator.cpp @@ -24,7 +24,7 @@ void RangeAllocator::initialize_with_range(VirtualAddress base, size_t size) m_available_ranges.append({ base, size }); } -void RangeAllocator::initialize_from_parent(const RangeAllocator& parent_allocator) +void RangeAllocator::initialize_from_parent(RangeAllocator const& parent_allocator) { ScopedSpinLock lock(parent_allocator.m_lock); m_total_range = parent_allocator.m_total_range; @@ -44,7 +44,7 @@ void RangeAllocator::dump() const } } -void RangeAllocator::carve_at_index(int index, const Range& range) +void RangeAllocator::carve_at_index(int index, Range const& range) { VERIFY(m_lock.is_locked()); auto remaining_parts = m_available_ranges[index].carve(range); @@ -153,7 +153,7 @@ Optional<Range> RangeAllocator::allocate_specific(VirtualAddress base, size_t si return {}; } -void RangeAllocator::deallocate(const Range& range) +void RangeAllocator::deallocate(Range const& range) { ScopedSpinLock lock(m_lock); VERIFY(m_total_range.contains(range)); diff --git a/Kernel/VM/RangeAllocator.h b/Kernel/VM/RangeAllocator.h index bb5e866ab9..e98eb95a01 100644 --- a/Kernel/VM/RangeAllocator.h +++ b/Kernel/VM/RangeAllocator.h @@ -19,23 +19,23 @@ public: ~RangeAllocator(); void initialize_with_range(VirtualAddress, size_t); - void initialize_from_parent(const RangeAllocator&); + void initialize_from_parent(RangeAllocator const&); Optional<Range> allocate_anywhere(size_t, size_t alignment = PAGE_SIZE); Optional<Range> allocate_specific(VirtualAddress, size_t); Optional<Range> allocate_randomized(size_t, size_t alignment); - void deallocate(const Range&); + void deallocate(Range const&); void dump() const; - bool contains(const Range& range) const + bool contains(Range const& range) const { ScopedSpinLock lock(m_lock); return m_total_range.contains(range); } private: - void carve_at_index(int, const Range&); + void carve_at_index(int, Range const&); Vector<Range> m_available_ranges; Range m_total_range; |