From 06a08de68a95506a9cbe4633c58f6bdb5ded0c70 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 28 Feb 2026 01:06:33 +0100 Subject: [core/loader] prevent program_image reallocations in NSO+KIP loading methods (#3639) also changes some methods to std::span<> as well, but mainly std::vector<> in the NSO/KIP loading stuff is not needed to be memcpy'ed and memmove'd around this should save a marginal amount of loading time (RDR1) Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3639 Reviewed-by: DraVee Reviewed-by: Maufeat Co-authored-by: lizzie Co-committed-by: lizzie --- src/core/file_sys/kernel_executable.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core/file_sys/kernel_executable.cpp') diff --git a/src/core/file_sys/kernel_executable.cpp b/src/core/file_sys/kernel_executable.cpp index b84492d30a..dea05f840f 100644 --- a/src/core/file_sys/kernel_executable.cpp +++ b/src/core/file_sys/kernel_executable.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -160,15 +163,15 @@ u32 KIP::GetMainThreadCpuCore() const { return header.default_core; } -const std::vector& KIP::GetTextSection() const { +std::span KIP::GetTextSection() const { return decompressed_sections[0]; } -const std::vector& KIP::GetRODataSection() const { +std::span KIP::GetRODataSection() const { return decompressed_sections[1]; } -const std::vector& KIP::GetDataSection() const { +std::span KIP::GetDataSection() const { return decompressed_sections[2]; } -- cgit v1.2.3