summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-12-05 21:00:34 +0100
committerLioncash <mathew1800@gmail.com>2022-12-05 21:27:47 +0100
commitc3fd211b43db98309da537533a8b57e1d734d665 (patch)
tree8a8e25322acb233ec6af67f9a4ea176c699adc99 /src/core
parentkernel/physical_core: Ensure is_interrupted is always initialized (diff)
downloadyuzu-c3fd211b43db98309da537533a8b57e1d734d665.tar
yuzu-c3fd211b43db98309da537533a8b57e1d734d665.tar.gz
yuzu-c3fd211b43db98309da537533a8b57e1d734d665.tar.bz2
yuzu-c3fd211b43db98309da537533a8b57e1d734d665.tar.lz
yuzu-c3fd211b43db98309da537533a8b57e1d734d665.tar.xz
yuzu-c3fd211b43db98309da537533a8b57e1d734d665.tar.zst
yuzu-c3fd211b43db98309da537533a8b57e1d734d665.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/k_memory_block.h33
-rw-r--r--src/core/hle/kernel/k_memory_block_manager.h9
2 files changed, 20 insertions, 22 deletions
diff --git a/src/core/hle/kernel/k_memory_block.h b/src/core/hle/kernel/k_memory_block.h
index 3b6e7baff..87ca65592 100644
--- a/src/core/hle/kernel/k_memory_block.h
+++ b/src/core/hle/kernel/k_memory_block.h
@@ -280,18 +280,19 @@ struct KMemoryInfo {
class KMemoryBlock : public Common::IntrusiveRedBlackTreeBaseNode<KMemoryBlock> {
private:
- u16 m_device_disable_merge_left_count;
- u16 m_device_disable_merge_right_count;
- VAddr m_address;
- size_t m_num_pages;
- KMemoryState m_memory_state;
- u16 m_ipc_lock_count;
- u16 m_device_use_count;
- u16 m_ipc_disable_merge_count;
- KMemoryPermission m_permission;
- KMemoryPermission m_original_permission;
- KMemoryAttribute m_attribute;
- KMemoryBlockDisableMergeAttribute m_disable_merge_attribute;
+ u16 m_device_disable_merge_left_count{};
+ u16 m_device_disable_merge_right_count{};
+ VAddr m_address{};
+ size_t m_num_pages{};
+ KMemoryState m_memory_state{KMemoryState::None};
+ u16 m_ipc_lock_count{};
+ u16 m_device_use_count{};
+ u16 m_ipc_disable_merge_count{};
+ KMemoryPermission m_permission{KMemoryPermission::None};
+ KMemoryPermission m_original_permission{KMemoryPermission::None};
+ KMemoryAttribute m_attribute{KMemoryAttribute::None};
+ KMemoryBlockDisableMergeAttribute m_disable_merge_attribute{
+ KMemoryBlockDisableMergeAttribute::None};
public:
static constexpr int Compare(const KMemoryBlock& lhs, const KMemoryBlock& rhs) {
@@ -367,12 +368,8 @@ public:
constexpr KMemoryBlock(VAddr addr, size_t np, KMemoryState ms, KMemoryPermission p,
KMemoryAttribute attr)
- : Common::IntrusiveRedBlackTreeBaseNode<KMemoryBlock>(),
- m_device_disable_merge_left_count(), m_device_disable_merge_right_count(),
- m_address(addr), m_num_pages(np), m_memory_state(ms), m_ipc_lock_count(0),
- m_device_use_count(0), m_ipc_disable_merge_count(), m_permission(p),
- m_original_permission(KMemoryPermission::None), m_attribute(attr),
- m_disable_merge_attribute() {}
+ : Common::IntrusiveRedBlackTreeBaseNode<KMemoryBlock>(), m_address(addr), m_num_pages(np),
+ m_memory_state(ms), m_permission(p), m_attribute(attr) {}
constexpr void Initialize(VAddr addr, size_t np, KMemoryState ms, KMemoryPermission p,
KMemoryAttribute attr) {
diff --git a/src/core/hle/kernel/k_memory_block_manager.h b/src/core/hle/kernel/k_memory_block_manager.h
index 9b5873883..d382722a6 100644
--- a/src/core/hle/kernel/k_memory_block_manager.h
+++ b/src/core/hle/kernel/k_memory_block_manager.h
@@ -3,6 +3,7 @@
#pragma once
+#include <array>
#include <functional>
#include "common/common_funcs.h"
@@ -17,9 +18,9 @@ public:
static constexpr size_t MaxBlocks = 2;
private:
- KMemoryBlock* m_blocks[MaxBlocks];
- size_t m_index;
- KMemoryBlockSlabManager* m_slab_manager;
+ std::array<KMemoryBlock*, MaxBlocks> m_blocks{};
+ size_t m_index{MaxBlocks};
+ KMemoryBlockSlabManager* m_slab_manager{};
private:
Result Initialize(size_t num_blocks) {
@@ -41,7 +42,7 @@ private:
public:
KMemoryBlockManagerUpdateAllocator(Result* out_result, KMemoryBlockSlabManager* sm,
size_t num_blocks = MaxBlocks)
- : m_blocks(), m_index(MaxBlocks), m_slab_manager(sm) {
+ : m_slab_manager(sm) {
*out_result = this->Initialize(num_blocks);
}