summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar bunnei2021-05-01 22:30:42 -0700
committerGravatar bunnei2021-05-05 16:40:54 -0700
commitf23760b1e1b4dc703dffaa245b7b469141935342 (patch)
tree0dd9954ac583dd3de021cee59ded1d152ea1ea55 /src/core/hle/kernel
parentfixup! hle: kernel: Migrate to KHandleTable. (diff)
downloadyuzu-f23760b1e1b4dc703dffaa245b7b469141935342.tar.gz
yuzu-f23760b1e1b4dc703dffaa245b7b469141935342.tar.xz
yuzu-f23760b1e1b4dc703dffaa245b7b469141935342.zip
fixup! hle: kernel: Add initial impl. of slab setup.
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/init/init_slab_setup.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp
index 3aa76ee33..2dd792e71 100644
--- a/src/core/hle/kernel/init/init_slab_setup.cpp
+++ b/src/core/hle/kernel/init/init_slab_setup.cpp
@@ -117,10 +117,6 @@ void InitializeSlabResourceCounts() {
117 } 117 }
118} 118}
119 119
120size_t CalculateSlabHeapGapSize() {
121 return KernelSlabHeapGapsSize;
122}
123
124size_t CalculateTotalSlabHeapSize() { 120size_t CalculateTotalSlabHeapSize() {
125 size_t size = 0; 121 size_t size = 0;
126 122
@@ -136,7 +132,7 @@ size_t CalculateTotalSlabHeapSize() {
136#undef ADD_SLAB_SIZE 132#undef ADD_SLAB_SIZE
137 133
138 // Add the reserved size. 134 // Add the reserved size.
139 size += CalculateSlabHeapGapSize(); 135 size += KernelSlabHeapGapsSize;
140 136
141 return size; 137 return size;
142} 138}
@@ -158,7 +154,7 @@ void InitializeSlabHeaps(Core::System& system, KMemoryLayout& memory_layout) {
158 } 154 }
159 155
160 // Create an array to represent the gaps between the slabs. 156 // Create an array to represent the gaps between the slabs.
161 const size_t total_gap_size = CalculateSlabHeapGapSize(); 157 const size_t total_gap_size = KernelSlabHeapGapsSize;
162 std::array<size_t, slab_types.size()> slab_gaps; 158 std::array<size_t, slab_types.size()> slab_gaps;
163 for (size_t i = 0; i < slab_gaps.size(); i++) { 159 for (size_t i = 0; i < slab_gaps.size(); i++) {
164 // Note: This is an off-by-one error from Nintendo's intention, because GenerateRandomRange 160 // Note: This is an off-by-one error from Nintendo's intention, because GenerateRandomRange