aboutsummaryrefslogtreecommitdiff
path: root/src/core/arm/nce/patcher.cpp
diff options
context:
space:
mode:
authorMrPurple666 <mrpurple666@noreply.localhost>2025-06-21 19:32:32 +0000
committerJPikachu <jpikachu@noreply.localhost>2025-06-21 19:32:32 +0000
commit2f01c69710c787ebeb221bf3fd5d4eee65877b60 (patch)
treeab7f469b0c307a30d1711c55dffa6bf152d9b6fe /src/core/arm/nce/patcher.cpp
parent2946cdbd2d4ab802e80ab7daa6cd3004067ae848 (diff)
LRU Cache Refactor with Thread-Safety (#199)
The cache is now thread-safe using std::shared_mutex, allowing concurrent reads without blocking and some other minor things to better maintenance Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/199 Co-authored-by: MrPurple666 <mrpurple666@noreply.localhost> Co-committed-by: MrPurple666 <mrpurple666@noreply.localhost>
Diffstat (limited to 'src/core/arm/nce/patcher.cpp')
-rw-r--r--src/core/arm/nce/patcher.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/core/arm/nce/patcher.cpp b/src/core/arm/nce/patcher.cpp
index f6563bb20f..6f476caa81 100644
--- a/src/core/arm/nce/patcher.cpp
+++ b/src/core/arm/nce/patcher.cpp
@@ -1,5 +1,5 @@
-// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
-// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2025 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
#include "common/arm64/native_clock.h"
#include "common/bit_cast.h"
@@ -14,6 +14,23 @@
namespace Core::NCE {
+Patcher::Patcher(Patcher&& other) noexcept
+ : patch_cache(std::move(other.patch_cache)),
+ m_patch_instructions(std::move(other.m_patch_instructions)),
+ c(m_patch_instructions),
+ m_save_context(other.m_save_context),
+ m_load_context(other.m_load_context),
+ mode(other.mode),
+ total_program_size(other.total_program_size),
+ m_relocate_module_index(other.m_relocate_module_index),
+ modules(std::move(other.modules)),
+ curr_patch(nullptr) {
+ if (!modules.empty()) {
+ curr_patch = &modules.back();
+ }
+}
+
+
using namespace Common::Literals;
using namespace oaknut::util;