summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2021-03-23 18:37:39 -0700
committerGravatar bunnei2021-03-23 18:37:39 -0700
commit4eac8703d23be2b3ddfab36d93608c2398bbaa0a (patch)
treebfb6eb983e0c371445a62bbd83486db41cac5d39 /src
parenthle: kernel: k_memory_layout: Use pair instead of tuple. (diff)
downloadyuzu-4eac8703d23be2b3ddfab36d93608c2398bbaa0a.tar.gz
yuzu-4eac8703d23be2b3ddfab36d93608c2398bbaa0a.tar.xz
yuzu-4eac8703d23be2b3ddfab36d93608c2398bbaa0a.zip
hle: kernel: k_memory_region: Minor code cleanup.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_memory_region.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/hle/kernel/k_memory_region.h b/src/core/hle/kernel/k_memory_region.h
index 782c21fbf..a861c04ab 100644
--- a/src/core/hle/kernel/k_memory_region.h
+++ b/src/core/hle/kernel/k_memory_region.h
@@ -160,7 +160,7 @@ private:
160 KMemoryRegionAllocator& memory_region_allocator; 160 KMemoryRegionAllocator& memory_region_allocator;
161 161
162public: 162public:
163 KMemoryRegionTree(KMemoryRegionAllocator& memory_region_allocator_); 163 explicit KMemoryRegionTree(KMemoryRegionAllocator& memory_region_allocator_);
164 164
165public: 165public:
166 KMemoryRegion* FindModifiable(u64 address) { 166 KMemoryRegion* FindModifiable(u64 address) {
@@ -328,14 +328,8 @@ class KMemoryRegionAllocator final : NonCopyable {
328public: 328public:
329 static constexpr size_t MaxMemoryRegions = 200; 329 static constexpr size_t MaxMemoryRegions = 200;
330 330
331private:
332 std::array<KMemoryRegion, MaxMemoryRegions> region_heap{};
333 size_t num_regions{};
334
335public:
336 constexpr KMemoryRegionAllocator() = default; 331 constexpr KMemoryRegionAllocator() = default;
337 332
338public:
339 template <typename... Args> 333 template <typename... Args>
340 KMemoryRegion* Allocate(Args&&... args) { 334 KMemoryRegion* Allocate(Args&&... args) {
341 // Ensure we stay within the bounds of our heap. 335 // Ensure we stay within the bounds of our heap.
@@ -347,6 +341,10 @@ public:
347 341
348 return region; 342 return region;
349 } 343 }
344
345private:
346 std::array<KMemoryRegion, MaxMemoryRegions> region_heap{};
347 size_t num_regions{};
350}; 348};
351 349
352} // namespace Kernel 350} // namespace Kernel