diff options
| author | 2018-12-05 02:33:13 -0500 | |
|---|---|---|
| committer | 2018-12-05 02:33:17 -0500 | |
| commit | edd9bfd54a098f22b2f3c3a75d137cb86ef9a5d0 (patch) | |
| tree | 496b570e6e7dfe86c01b71cc667566d3eca79be1 /src | |
| parent | Merge pull request #1859 from heapo/lut_array_codegen (diff) | |
| download | yuzu-edd9bfd54a098f22b2f3c3a75d137cb86ef9a5d0.tar.gz yuzu-edd9bfd54a098f22b2f3c3a75d137cb86ef9a5d0.tar.xz yuzu-edd9bfd54a098f22b2f3c3a75d137cb86ef9a5d0.zip | |
system_archive: Use a regular function pointer instead of std::function for file-scope system archive array
This allows the array to be constexpr. std::function is also allowed to
allocate memory, which makes its constructor non-trivial, we definitely
don't want to have all of these execute at runtime, taking up time
before the application can actually load.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/system_archive/system_archive.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/file_sys/system_archive/system_archive.cpp b/src/core/file_sys/system_archive/system_archive.cpp index c9c40a07d..d3883267c 100644 --- a/src/core/file_sys/system_archive/system_archive.cpp +++ b/src/core/file_sys/system_archive/system_archive.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <functional> | ||
| 6 | #include "common/logging/log.h" | 5 | #include "common/logging/log.h" |
| 7 | #include "core/file_sys/romfs.h" | 6 | #include "core/file_sys/romfs.h" |
| 8 | #include "core/file_sys/system_archive/ng_word.h" | 7 | #include "core/file_sys/system_archive/ng_word.h" |
| @@ -13,7 +12,7 @@ namespace FileSys::SystemArchive { | |||
| 13 | constexpr u64 SYSTEM_ARCHIVE_BASE_TITLE_ID = 0x0100000000000800; | 12 | constexpr u64 SYSTEM_ARCHIVE_BASE_TITLE_ID = 0x0100000000000800; |
| 14 | constexpr std::size_t SYSTEM_ARCHIVE_COUNT = 0x28; | 13 | constexpr std::size_t SYSTEM_ARCHIVE_COUNT = 0x28; |
| 15 | 14 | ||
| 16 | using SystemArchiveSupplier = std::function<VirtualDir()>; | 15 | using SystemArchiveSupplier = VirtualDir (*)(); |
| 17 | 16 | ||
| 18 | struct SystemArchiveDescriptor { | 17 | struct SystemArchiveDescriptor { |
| 19 | u64 title_id; | 18 | u64 title_id; |
| @@ -21,7 +20,7 @@ struct SystemArchiveDescriptor { | |||
| 21 | SystemArchiveSupplier supplier; | 20 | SystemArchiveSupplier supplier; |
| 22 | }; | 21 | }; |
| 23 | 22 | ||
| 24 | const std::array<SystemArchiveDescriptor, SYSTEM_ARCHIVE_COUNT> SYSTEM_ARCHIVES = {{ | 23 | constexpr std::array<SystemArchiveDescriptor, SYSTEM_ARCHIVE_COUNT> SYSTEM_ARCHIVES{{ |
| 25 | {0x0100000000000800, "CertStore", nullptr}, | 24 | {0x0100000000000800, "CertStore", nullptr}, |
| 26 | {0x0100000000000801, "ErrorMessage", nullptr}, | 25 | {0x0100000000000801, "ErrorMessage", nullptr}, |
| 27 | {0x0100000000000802, "MiiModel", nullptr}, | 26 | {0x0100000000000802, "MiiModel", nullptr}, |