summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/init
diff options
context:
space:
mode:
authorGravatar arades792023-02-11 13:28:03 -0500
committerGravatar arades792023-02-14 12:33:11 -0500
commit45e13b03f372230dbf780f3fa87dd88f388af605 (patch)
tree555593e7e5016b6ba2a777d7417ada244abce458 /src/core/hle/kernel/init
parentMerge pull request #9795 from Kelebek1/biquad_fix (diff)
downloadyuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.gz
yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.xz
yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.zip
add static lifetime to constexpr values to force compile time evaluation where possible
Signed-off-by: arades79 <scravers@protonmail.com>
Diffstat (limited to 'src/core/hle/kernel/init')
-rw-r--r--src/core/hle/kernel/init/init_slab_setup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp
index 571acf4b2..951326a85 100644
--- a/src/core/hle/kernel/init/init_slab_setup.cpp
+++ b/src/core/hle/kernel/init/init_slab_setup.cpp
@@ -129,7 +129,7 @@ VAddr InitializeSlabHeap(Core::System& system, KMemoryLayout& memory_layout, VAd
129} 129}
130 130
131size_t CalculateSlabHeapGapSize() { 131size_t CalculateSlabHeapGapSize() {
132 constexpr size_t KernelSlabHeapGapSize = 2_MiB - 320_KiB; 132 constexpr static size_t KernelSlabHeapGapSize = 2_MiB - 320_KiB;
133 static_assert(KernelSlabHeapGapSize <= KernelSlabHeapGapsSizeMax); 133 static_assert(KernelSlabHeapGapSize <= KernelSlabHeapGapsSizeMax);
134 return KernelSlabHeapGapSize; 134 return KernelSlabHeapGapSize;
135} 135}
@@ -272,7 +272,7 @@ void KPageBufferSlabHeap::Initialize(Core::System& system) {
272 kernel.GetSystemResourceLimit()->Reserve(LimitableResource::PhysicalMemoryMax, slab_size)); 272 kernel.GetSystemResourceLimit()->Reserve(LimitableResource::PhysicalMemoryMax, slab_size));
273 273
274 // Allocate memory for the slab. 274 // Allocate memory for the slab.
275 constexpr auto AllocateOption = KMemoryManager::EncodeOption( 275 constexpr static auto AllocateOption = KMemoryManager::EncodeOption(
276 KMemoryManager::Pool::System, KMemoryManager::Direction::FromFront); 276 KMemoryManager::Pool::System, KMemoryManager::Direction::FromFront);
277 const PAddr slab_address = 277 const PAddr slab_address =
278 kernel.MemoryManager().AllocateAndOpenContinuous(num_pages, 1, AllocateOption); 278 kernel.MemoryManager().AllocateAndOpenContinuous(num_pages, 1, AllocateOption);