summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_shared_memory_info.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_shared_memory_info.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/core/hle/kernel/k_shared_memory_info.h b/src/core/hle/kernel/k_shared_memory_info.h
index 2bb6b6d08..2d8ff20d6 100644
--- a/src/core/hle/kernel/k_shared_memory_info.h
+++ b/src/core/hle/kernel/k_shared_memory_info.h
@@ -3,7 +3,7 @@
#pragma once
-#include <boost/intrusive/list.hpp>
+#include "common/intrusive_list.h"
#include "core/hle/kernel/slab_helpers.h"
@@ -12,31 +12,34 @@ namespace Kernel {
class KSharedMemory;
class KSharedMemoryInfo final : public KSlabAllocated<KSharedMemoryInfo>,
- public boost::intrusive::list_base_hook<> {
+ public Common::IntrusiveListBaseNode<KSharedMemoryInfo> {
public:
explicit KSharedMemoryInfo(KernelCore&) {}
KSharedMemoryInfo() = default;
- constexpr void Initialize(KSharedMemory* shmem) {
- shared_memory = shmem;
+ constexpr void Initialize(KSharedMemory* m) {
+ m_shared_memory = m;
+ m_reference_count = 0;
}
constexpr KSharedMemory* GetSharedMemory() const {
- return shared_memory;
+ return m_shared_memory;
}
constexpr void Open() {
- ++reference_count;
+ ++m_reference_count;
+ ASSERT(m_reference_count > 0);
}
constexpr bool Close() {
- return (--reference_count) == 0;
+ ASSERT(m_reference_count > 0);
+ return (--m_reference_count) == 0;
}
private:
- KSharedMemory* shared_memory{};
- size_t reference_count{};
+ KSharedMemory* m_shared_memory{};
+ size_t m_reference_count{};
};
} // namespace Kernel