summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-02 04:20:05 +0200
committerGitHub <noreply@github.com>2019-04-02 04:20:05 +0200
commit29df6bbbd368a8265a401e8d529453352b43d5e1 (patch)
tree36ed85250c33cea2623765e7bc6c3f1708932b2e /src/core/hle/kernel
parentMerge pull request #2301 from FearlessTobi/remove-amiibo-setting (diff)
parentkernel/codeset: Make CodeSet's memory data member a regular std::vector (diff)
downloadyuzu-29df6bbbd368a8265a401e8d529453352b43d5e1.tar
yuzu-29df6bbbd368a8265a401e8d529453352b43d5e1.tar.gz
yuzu-29df6bbbd368a8265a401e8d529453352b43d5e1.tar.bz2
yuzu-29df6bbbd368a8265a401e8d529453352b43d5e1.tar.lz
yuzu-29df6bbbd368a8265a401e8d529453352b43d5e1.tar.xz
yuzu-29df6bbbd368a8265a401e8d529453352b43d5e1.tar.zst
yuzu-29df6bbbd368a8265a401e8d529453352b43d5e1.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/code_set.h3
-rw-r--r--src/core/hle/kernel/process.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/kernel/code_set.h b/src/core/hle/kernel/code_set.h
index 834fd23d2..879957dcb 100644
--- a/src/core/hle/kernel/code_set.h
+++ b/src/core/hle/kernel/code_set.h
@@ -5,7 +5,6 @@
#pragma once
#include <cstddef>
-#include <memory>
#include <vector>
#include "common/common_types.h"
@@ -78,7 +77,7 @@ struct CodeSet final {
}
/// The overall data that backs this code set.
- std::shared_ptr<std::vector<u8>> memory;
+ std::vector<u8> memory;
/// The segments that comprise this code set.
std::array<Segment, 3> segments;
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index b0b7af76b..a5144b8ad 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -218,11 +218,13 @@ void Process::FreeTLSSlot(VAddr tls_address) {
}
void Process::LoadModule(CodeSet module_, VAddr base_addr) {
+ const auto memory = std::make_shared<std::vector<u8>>(std::move(module_.memory));
+
const auto MapSegment = [&](const CodeSet::Segment& segment, VMAPermission permissions,
MemoryState memory_state) {
const auto vma = vm_manager
- .MapMemoryBlock(segment.addr + base_addr, module_.memory,
- segment.offset, segment.size, memory_state)
+ .MapMemoryBlock(segment.addr + base_addr, memory, segment.offset,
+ segment.size, memory_state)
.Unwrap();
vm_manager.Reprotect(vma, permissions);
};