diff --git a/.patch/unordered-dense/0001-avoid-memset-when-clearing-an-empty-table.patch b/.patch/unordered-dense/0001-avoid-memset-when-clearing-an-empty-table.patch deleted file mode 100644 index f7d7c7ebe2..0000000000 --- a/.patch/unordered-dense/0001-avoid-memset-when-clearing-an-empty-table.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b3622608433c183ba868a1dc8dd9cf285eb3b916 Mon Sep 17 00:00:00 2001 -From: Dario Petrillo -Date: Thu, 27 Nov 2025 23:12:38 +0100 -Subject: [PATCH] avoid extra memset when clearing an empty table - ---- - include/ankerl/unordered_dense.h | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/include/ankerl/unordered_dense.h b/include/ankerl/unordered_dense.h -index 0835342..4938212 100644 ---- a/include/ankerl/unordered_dense.h -+++ b/include/ankerl/unordered_dense.h -@@ -1490,8 +1490,10 @@ class table : public std::conditional_t, base_table_type_map, bas - // modifiers ////////////////////////////////////////////////////////////// - - void clear() { -- m_values.clear(); -- clear_buckets(); -+ if (!empty()) { -+ m_values.clear(); -+ clear_buckets(); -+ } - } - - auto insert(value_type const& value) -> std::pair { diff --git a/CMakeLists.txt b/CMakeLists.txt index cbcdaccd0c..477e7c636d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -540,7 +540,6 @@ add_subdirectory(externals) # pass targets from externals # TODO(crueter): CPMUtil Propagate func? find_package(enet) -find_package(unordered_dense REQUIRED) if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) find_package(xbyak) diff --git a/cpmfile.json b/cpmfile.json index 66b8ae89ab..ce6275fb99 100644 --- a/cpmfile.json +++ b/cpmfile.json @@ -301,17 +301,6 @@ "repo": "eden-emu/tzdb_to_nx", "version": "230326" }, - "unordered-dense": { - "bundled": true, - "find_args": "CONFIG", - "hash": "d2106f6640f6bfb81755e4b8bfb64982e46ec4a507cacdb38f940123212ccf35a20b43c70c6f01d7bfb8c246d1a16f7845d8052971949cea9def1475e3fa02c8", - "package": "unordered_dense", - "patches": [ - "0001-avoid-memset-when-clearing-an-empty-table.patch" - ], - "repo": "martinus/unordered_dense", - "version": "7b55cab841" - }, "vulkan-headers": { "hash": "d2846ea228415772645eea4b52a9efd33e6a563043dd3de059e798be6391a8f0ca089f455ae420ff22574939ed0f48ed7c6ff3d5a9987d5231dbf3b3f89b484b", "min_version": "1.4.317", diff --git a/docs/Deps.md b/docs/Deps.md index 612e423d9f..96308c32d0 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -80,7 +80,6 @@ Certain other dependencies will be fetched by CPM regardless. System packages *c * [httplib](https://github.com/yhirose/cpp-httplib) - if `ENABLE_UPDATE_CHECKER` or `ENABLE_WEB_SERVICE` are on * This package is known to be broken on the AUR. * [cpp-jwt](https://github.com/arun11299/cpp-jwt) 1.4+ - if `ENABLE_WEB_SERVICE` is on -* [unordered-dense](https://github.com/martinus/unordered_dense) On amd64: @@ -119,7 +118,7 @@ Now, install all deps: sudo emerge -a \ app-arch/lz4 app-arch/zstd app-arch/unzip \ dev-libs/libfmt dev-libs/libusb dev-libs/mcl dev-libs/sirit \ - dev-libs/unordered_dense dev-libs/boost dev-libs/openssl dev-libs/discord-rpc \ + dev-libs/boost dev-libs/openssl dev-libs/discord-rpc \ dev-util/spirv-tools dev-util/spirv-headers dev-util/vulkan-headers \ dev-util/vulkan-utility-libraries dev-util/glslang \ media-gfx/renderdoc media-libs/libva media-libs/opus media-video/ffmpeg \ @@ -260,7 +259,7 @@ brew install molten-vk
FreeBSD -As root run: `pkg install devel/cmake sdl3 devel/boost-libs devel/catch2 devel/libfmt devel/nlohmann-json devel/ninja devel/nasm devel/autoconf devel/pkgconf devel/qt6-base devel/qt6-charts devel/simpleini net/enet multimedia/ffnvcodec-headers multimedia/ffmpeg audio/opus archivers/liblz4 lang/gcc12 graphics/glslang graphics/vulkan-utility-libraries graphics/spirv-tools www/cpp-httplib devel/unordered-dense vulkan-headers quazip-qt6` +As root run: `pkg install devel/cmake sdl3 devel/boost-libs devel/catch2 devel/libfmt devel/nlohmann-json devel/ninja devel/nasm devel/autoconf devel/pkgconf devel/qt6-base devel/qt6-charts devel/simpleini net/enet multimedia/ffnvcodec-headers multimedia/ffmpeg audio/opus archivers/liblz4 lang/gcc12 graphics/glslang graphics/vulkan-utility-libraries graphics/spirv-tools www/cpp-httplib vulkan-headers quazip-qt6` If using FreeBSD 12 or prior, use `devel/pkg-config` instead. @@ -294,7 +293,7 @@ pkg_add cmake nasm git boost unzip--iconv autoconf-2.72p0 bash ffmpeg glslang gm DragonFlyBSD ```sh -pkg install gcc14 git cmake unzip nasm autoconf bash pkgconf ffmpeg glslang gmake jq nlohmann-json enet spirv-tools sdl3 vulkan-utility-libraries vulkan-headers catch2 libfmt openssl liblz4 boost-libs cpp-httplib qt6-base qt6-charts quazip-qt6 unordered-dense libva-vdpau-driver libva-utils libva-intel-driver +pkg install gcc14 git cmake unzip nasm autoconf bash pkgconf ffmpeg glslang gmake jq nlohmann-json enet spirv-tools sdl3 vulkan-utility-libraries vulkan-headers catch2 libfmt openssl liblz4 boost-libs cpp-httplib qt6-base qt6-charts quazip-qt6 libva-vdpau-driver libva-utils libva-intel-driver ``` [Caveats](./Caveats.md#dragonflybsd). @@ -328,7 +327,7 @@ sudo pkgin install git cmake autoconf build-essential libusb-1 nasm gcc13 ```sh BASE="git make autoconf libtool automake-wrapper jq patch" -MINGW="qt6-base qt6-charts qt6-tools qt6-translations qt6-svg cmake toolchain clang python-pip openssl vulkan-memory-allocator vulkan-devel glslang boost fmt lz4 nlohmann-json zlib zstd enet opus libusb unordered_dense openssl SDL3" +MINGW="qt6-base qt6-charts qt6-tools qt6-translations qt6-svg cmake toolchain clang python-pip openssl vulkan-memory-allocator vulkan-devel glslang boost fmt lz4 nlohmann-json zlib zstd enet opus libusb openssl SDL3" # Either x86_64 or clang-aarch64 (Windows on ARM) packages="$BASE" for pkg in $MINGW; do diff --git a/docs/dynarmic/README.md b/docs/dynarmic/README.md index bfba7c9cb0..d6f3f2af40 100644 --- a/docs/dynarmic/README.md +++ b/docs/dynarmic/README.md @@ -308,31 +308,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` -### unordered_dense - -``` -MIT License - -Copyright (c) 2022 Martin Leitner-Ankerl - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -``` ### xbyak diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index f190f68b9d..e89a766106 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -58,9 +58,6 @@ if (WIN32 AND NOT TARGET LLVM::Demangle) add_library(LLVM::Demangle ALIAS demangle) endif() -# unordered_dense -AddJsonPackage(unordered-dense) - # httplib if (IOS) set(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF) diff --git a/src/android/app/src/main/jni/game_metadata.cpp b/src/android/app/src/main/jni/game_metadata.cpp index 0f23e4d2ac..e7d97e1bd9 100644 --- a/src/android/app/src/main/jni/game_metadata.cpp +++ b/src/android/app/src/main/jni/game_metadata.cpp @@ -20,7 +20,7 @@ struct RomMetadata { std::vector icon; bool isHomebrew; }; -static ankerl::unordered_dense::map m_rom_metadata_cache; +static boost::container::unordered_flat_map m_rom_metadata_cache; static RomMetadata CacheRomMetadata(const std::string& path) { auto& instance = EmulationSession::GetInstance(); diff --git a/src/android/app/src/main/jni/native_input.cpp b/src/android/app/src/main/jni/native_input.cpp index 730d4f0a27..f53bc33121 100644 --- a/src/android/app/src/main/jni/native_input.cpp +++ b/src/android/app/src/main/jni/native_input.cpp @@ -21,7 +21,7 @@ #include "input_common/drivers/virtual_gamepad.h" #include "native.h" -ankerl::unordered_dense::map> map_profiles; +boost::container::unordered_flat_map> map_profiles; bool IsHandheldOnly() { const auto npad_style_set = diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 10e8cd0cc7..3ee1087116 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -241,7 +241,7 @@ if (lz4_ADDED) target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib) endif() -target_link_libraries(common PUBLIC fmt::fmt stb::headers Threads::Threads unordered_dense::unordered_dense) +target_link_libraries(common PUBLIC fmt::fmt stb::headers Threads::Threads) target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd) # Please refer to src/common/demangle.cpp diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 9adf210ab7..2e8227e9e2 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp @@ -7,7 +7,8 @@ #include #include #include -#include +#include +#include #include "common/assert.h" #include "common/fs/fs.h" @@ -196,8 +197,8 @@ private: SetLegacyPathImpl(legacy_path, new_path); } - ankerl::unordered_dense::map eden_paths; - ankerl::unordered_dense::map legacy_paths; + boost::container::unordered_flat_map eden_paths; + boost::container::unordered_flat_map legacy_paths; }; bool ValidatePath(const fs::path& path) { diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 445d34c444..3933d866f3 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -7,7 +7,8 @@ #ifdef _WIN32 #include -#include +#include +#include #include #include #include "common/dynamic_library.h" @@ -391,7 +392,7 @@ private: std::mutex placeholder_mutex; ///< Mutex for placeholders boost::icl::separate_interval_set placeholders; ///< Mapped placeholders - ankerl::unordered_dense::map placeholder_host_pointers; ///< Placeholder backing offset + boost::container::unordered_flat_map placeholder_host_pointers; ///< Placeholder backing offset }; #elif defined(__OPENORBIS__) || defined(__managarm__) diff --git a/src/common/input.h b/src/common/input.h index bd9b2d1656..7839623761 100644 --- a/src/common/input.h +++ b/src/common/input.h @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include #include "common/logging.h" @@ -412,7 +413,7 @@ public: namespace Impl { template -using FactoryListType = ankerl::unordered_dense::map>>; +using FactoryListType = boost::container::unordered_flat_map>>; template struct FactoryList { diff --git a/src/common/param_package.h b/src/common/param_package.h index 0216863a39..95715bab32 100644 --- a/src/common/param_package.h +++ b/src/common/param_package.h @@ -8,14 +8,15 @@ #include #include -#include +#include +#include namespace Common { /// A string-based key-value container supporting serializing to and deserializing from a string class ParamPackage { public: - using DataType = ankerl::unordered_dense::map; + using DataType = boost::container::unordered_flat_map; ParamPackage() = default; explicit ParamPackage(const std::string& serialized); diff --git a/src/common/x64/xbyak.h b/src/common/x64/xbyak.h index 5288c5184f..4a3c1badcc 100644 --- a/src/common/x64/xbyak.h +++ b/src/common/x64/xbyak.h @@ -22,10 +22,11 @@ #endif // You must ensure this matches with src/common/x64/xbyak.h on root dir -#include +#include +#include #include -#define XBYAK_STD_UNORDERED_SET ankerl::unordered_dense::set -#define XBYAK_STD_UNORDERED_MAP ankerl::unordered_dense::map +#define XBYAK_STD_UNORDERED_SET boost::container::unordered_flat_set +#define XBYAK_STD_UNORDERED_MAP boost::container::unordered_flat_map #define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap #include #include diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.h b/src/core/arm/dynarmic/arm_dynarmic_64.h index 6d0760986f..4c4ba93cc3 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.h +++ b/src/core/arm/dynarmic/arm_dynarmic_64.h @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include #include diff --git a/src/core/arm/nce/patcher.h b/src/core/arm/nce/patcher.h index 04d8534351..0d72d825ab 100644 --- a/src/core/arm/nce/patcher.h +++ b/src/core/arm/nce/patcher.h @@ -4,7 +4,7 @@ #pragma once #include -#include +#include #include #include #include @@ -46,7 +46,7 @@ enum class PatchMode : u32 { using ModuleTextAddress = u64; using PatchTextAddress = u64; -using EntryTrampolines = ankerl::unordered_dense::map; +using EntryTrampolines = boost::container::flat_map; class Patcher { public: diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index 2022c9c2e7..be297e5130 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -8,7 +8,8 @@ #include #include #include -#include +#include +#include #include "common/hex_util.h" #include "common/logging.h" @@ -104,7 +105,7 @@ struct IPSwitchRecord { size_t count; }; struct IPSwitchCompiler::IPSwitchPatch { - ankerl::unordered_dense::map records; + boost::container::unordered_flat_map records; bool enabled; }; diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 83f5e265dd..910cdfa8d4 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -566,7 +566,7 @@ VirtualFile RegisteredCache::GetFileAtID(NcaID id) const { return file; } -static std::optional CheckMapForContentRecord(const ankerl::unordered_dense::map& map, u64 title_id, ContentRecordType type) { +static std::optional CheckMapForContentRecord(const boost::container::unordered_flat_map& map, u64 title_id, ContentRecordType type) { auto cmnt_iter = map.find(title_id); u8 id_offset = 0; diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index 0cc6cb56b4..4e35a4a6b4 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include "common/common_types.h" #include "core/crypto/key_manager.h" @@ -209,11 +208,11 @@ private: ContentProviderParsingFunction parser; // maps tid -> NcaID of meta - ankerl::unordered_dense::map meta_id; + boost::container::flat_map meta_id; // maps tid -> meta - ankerl::unordered_dense::map meta; + boost::container::flat_map meta; // maps tid -> meta for CNMT in yuzu_meta - ankerl::unordered_dense::map yuzu_meta; + boost::container::flat_map yuzu_meta; }; enum class ContentProviderUnionSlot { @@ -313,8 +312,8 @@ private: void ProcessXCI(const VirtualFile& file); std::vector load_dirs; - ankerl::unordered_dense::map, VirtualFile> entries; - ankerl::unordered_dense::map versions; + boost::container::flat_map, VirtualFile> entries; + boost::container::flat_map versions; std::vector multi_version_entries; }; diff --git a/src/core/file_sys/vfs/vfs_layered.cpp b/src/core/file_sys/vfs/vfs_layered.cpp index 8dabe03e16..9399a78060 100644 --- a/src/core/file_sys/vfs/vfs_layered.cpp +++ b/src/core/file_sys/vfs/vfs_layered.cpp @@ -4,9 +4,7 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include -#include -#include +#include #include #include "core/file_sys/vfs/vfs_layered.h" @@ -63,7 +61,7 @@ std::string LayeredVfsDirectory::GetFullPath() const { std::vector LayeredVfsDirectory::GetFiles() const { std::vector out; - ankerl::unordered_dense::set out_names; + boost::container::flat_set out_names; for (const auto& layer : dirs) { for (auto& file : layer->GetFiles()) { @@ -79,8 +77,7 @@ std::vector LayeredVfsDirectory::GetFiles() const { std::vector LayeredVfsDirectory::GetSubdirectories() const { std::vector out; - ankerl::unordered_dense::set out_names; - + boost::container::flat_set out_names; for (const auto& layer : dirs) { for (const auto& sd : layer->GetSubdirectories()) { out_names.emplace(sd->GetName()); diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index c861a9ea51..a29941cf03 100644 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h @@ -78,7 +78,7 @@ private: std::array m_watchpoints{}; std::map m_debug_page_refcounts{}; #ifdef HAS_NCE - ankerl::unordered_dense::map m_post_handlers{}; + boost::container::unordered_flat_map m_post_handlers{}; #endif std::unique_ptr m_exclusive_monitor; Core::Memory::Memory m_memory; @@ -494,7 +494,7 @@ public: static void Switch(KernelCore& kernel, KProcess* cur_process, KProcess* next_process); #ifdef HAS_NCE - ankerl::unordered_dense::map& GetPostHandlers() noexcept { + boost::container::unordered_flat_map& GetPostHandlers() noexcept { return m_post_handlers; } #endif diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index a739e7020c..41147b07f3 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include "common/assert.h" @@ -792,8 +793,8 @@ struct KernelCore::Impl { std::optional object_name_global_data; - ankerl::unordered_dense::set registered_objects; - ankerl::unordered_dense::set registered_in_use_objects; + boost::container::unordered_flat_set registered_objects; + boost::container::unordered_flat_set registered_in_use_objects; std::mutex server_lock; std::vector> server_managers; diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 04790c8b38..3d480697db 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include "common/polyfill_thread.h" diff --git a/src/core/hle/service/am/frontend/applet_web_browser_types.h b/src/core/hle/service/am/frontend/applet_web_browser_types.h index 3574568f6f..5d9e9fb749 100644 --- a/src/core/hle/service/am/frontend/applet_web_browser_types.h +++ b/src/core/hle/service/am/frontend/applet_web_browser_types.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include #include "common/common_funcs.h" @@ -176,6 +177,6 @@ struct WebCommonReturnValue { }; static_assert(sizeof(WebCommonReturnValue) == 0x1010, "WebCommonReturnValue has incorrect size."); -using WebArgInputTLVMap = ankerl::unordered_dense::map>; +using WebArgInputTLVMap = boost::container::unordered_flat_map>; } // namespace Service::AM::Frontend diff --git a/src/core/hle/service/bcat/news/builtin_news.cpp b/src/core/hle/service/bcat/news/builtin_news.cpp index 2a7756a155..d286fd8620 100644 --- a/src/core/hle/service/bcat/news/builtin_news.cpp +++ b/src/core/hle/service/bcat/news/builtin_news.cpp @@ -40,8 +40,8 @@ std::vector default_logo_small; std::vector default_logo_large; bool default_logos_loaded = false; -ankerl::unordered_dense::map> news_images_small; -ankerl::unordered_dense::map> news_images_large; +boost::container::unordered_flat_map> news_images_small; +boost::container::unordered_flat_map> news_images_large; std::mutex images_mutex; diff --git a/src/core/hle/service/bcat/news/news_storage.h b/src/core/hle/service/bcat/news/news_storage.h index 531e2adb9a..10045b6c5c 100644 --- a/src/core/hle/service/bcat/news/news_storage.h +++ b/src/core/hle/service/bcat/news/news_storage.h @@ -12,7 +12,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -93,7 +94,7 @@ private: static s64 Now(); mutable std::mutex mtx; - ankerl::unordered_dense::map items; + boost::container::unordered_flat_map items; size_t open_counter{}; }; diff --git a/src/core/hle/service/caps/caps_manager.h b/src/core/hle/service/caps/caps_manager.h index 22f5672e47..6730b87ee2 100644 --- a/src/core/hle/service/caps/caps_manager.h +++ b/src/core/hle/service/caps/caps_manager.h @@ -6,7 +6,8 @@ #pragma once -#include +#include +#include #include "common/fs/fs.h" #include "core/hle/result.h" @@ -88,7 +89,7 @@ private: AlbumFileDateTime ConvertToAlbumDateTime(u64 posix_time) const; bool is_mounted{}; - ankerl::unordered_dense::map album_files; + boost::container::unordered_flat_map album_files; Core::System& system; }; diff --git a/src/core/hle/service/ldn/lan_discovery.h b/src/core/hle/service/ldn/lan_discovery.h index fb24608ae1..ee4dc4c6fe 100644 --- a/src/core/hle/service/ldn/lan_discovery.h +++ b/src/core/hle/service/ldn/lan_discovery.h @@ -15,7 +15,8 @@ #include #include #include -#include +#include +#include #include "common/logging.h" #include "common/socket_types.h" @@ -119,7 +120,7 @@ protected: std::array stations; std::array node_changes{}; std::array node_last_states{}; - ankerl::unordered_dense::map scan_results{}; + boost::container::unordered_flat_map scan_results{}; NodeInfo node_info{}; NetworkInfo network_info{}; State state{State::None}; diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 1d9a610b30..3eae4f6e3e 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -7,7 +7,8 @@ #include #include -#include +#include +#include #include #include "common/logging.h" #include "core/core.h" @@ -331,7 +332,7 @@ private: }; static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size"); - ankerl::unordered_dense::map> entries{}; + boost::container::unordered_flat_map> entries{}; LogDestination destination{LogDestination::All}; }; diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 4408abae4d..0178d51c6d 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -23,7 +23,8 @@ #include #include #include -#include +#include +#include #include #ifdef _WIN32 diff --git a/src/core/hle/service/nvdrv/core/container.h b/src/core/hle/service/nvdrv/core/container.h index 62404e14a7..c13e1aab21 100644 --- a/src/core/hle/service/nvdrv/core/container.h +++ b/src/core/hle/service/nvdrv/core/container.h @@ -9,7 +9,8 @@ #include #include -#include +#include +#include #include "core/device_memory_manager.h" #include "core/hle/service/nvdrv/nvdata.h" diff --git a/src/core/hle/service/nvdrv/core/nvmap.h b/src/core/hle/service/nvdrv/core/nvmap.h index 17b9ccd1c7..69d3ab6598 100644 --- a/src/core/hle/service/nvdrv/core/nvmap.h +++ b/src/core/hle/service/nvdrv/core/nvmap.h @@ -12,7 +12,8 @@ #include #include #include -#include +#include +#include #include #include "common/bit_field.h" @@ -161,7 +162,7 @@ private: std::list> unmap_queue{}; std::mutex unmap_queue_lock{}; //!< Protects access to `unmap_queue` - ankerl::unordered_dense::map> + boost::container::unordered_flat_map> handles{}; //!< Main owning map of handles std::mutex handles_lock; //!< Protects access to `handles` diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h index b8ae57e1b4..75c4f648e7 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include #include #include "common/address_space.h" @@ -113,7 +114,7 @@ private: }; static_assert(sizeof(IoctlRemapEntry) == 20, "IoctlRemapEntry is incorrect size"); - ankerl::unordered_dense::set map_buffer_offsets{}; + boost::container::unordered_flat_set map_buffer_offsets{}; struct IoctlMapBufferEx { MappingFlags flags{}; // bit0: fixed_offset, bit2: cacheable diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h index c49aaa54a2..3c0e3afae6 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h @@ -217,7 +217,7 @@ private: NvCore::SyncpointManager& syncpoint_manager; NvCore::NvMap& nvmap; std::shared_ptr channel_state; - ankerl::unordered_dense::map sessions; + boost::container::unordered_flat_map sessions; u32 channel_syncpoint; std::mutex channel_mutex; diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h index 8b3b7ee285..83f37c399a 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include #include "common/common_types.h" @@ -138,7 +139,7 @@ protected: NvCore::NvMap& nvmap; NvCore::ChannelType channel_type; std::array device_syncpoints{}; - ankerl::unordered_dense::map sessions; + boost::container::unordered_flat_map sessions; }; }; // namespace Devices } // namespace Service::Nvidia diff --git a/src/core/hle/service/nvdrv/devices/nvmap.h b/src/core/hle/service/nvdrv/devices/nvmap.h index 19c5b479df..9b5f171e5d 100644 --- a/src/core/hle/service/nvdrv/devices/nvmap.h +++ b/src/core/hle/service/nvdrv/devices/nvmap.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include #include "common/common_funcs.h" #include "common/common_types.h" @@ -118,7 +119,7 @@ private: NvCore::Container& container; NvCore::NvMap& file; - ankerl::unordered_dense::map sessions; + boost::container::unordered_flat_map sessions; }; } // namespace Service::Nvidia::Devices diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index 329ac91c41..bfbee43c02 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h @@ -12,7 +12,8 @@ #include #include #include -#include +#include +#include #include "common/common_types.h" #include "core/hle/service/kernel_helpers.h" @@ -103,7 +104,7 @@ private: /// Id to use for the next open file descriptor. DeviceFD next_fd = 1; - using FilesContainerType = ankerl::unordered_dense::map>; + using FilesContainerType = boost::container::unordered_flat_map>; /// Mapping of file descriptors to the devices they reference. FilesContainerType open_files; @@ -111,7 +112,7 @@ private: EventInterface events_interface; - ankerl::unordered_dense::map> builders; + boost::container::unordered_flat_map> builders; }; void LoopProcess(Core::System& system); diff --git a/src/core/hle/service/nvnflinger/hos_binder_driver_server.h b/src/core/hle/service/nvnflinger/hos_binder_driver_server.h index b66f1776b0..3178f58e23 100644 --- a/src/core/hle/service/nvnflinger/hos_binder_driver_server.h +++ b/src/core/hle/service/nvnflinger/hos_binder_driver_server.h @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include "common/common_types.h" #include "core/hle/service/nvnflinger/binder.h" @@ -39,8 +40,8 @@ private: mutable std::mutex lock; s32 last_id = 0; - ankerl::unordered_dense::map> binders; - ankerl::unordered_dense::map refcounts; + boost::container::unordered_flat_map> binders; + boost::container::unordered_flat_map refcounts; }; } // namespace Service::Nvnflinger diff --git a/src/core/hle/service/olsc/daemon_controller.h b/src/core/hle/service/olsc/daemon_controller.h index 5f978ab153..6137449ae0 100644 --- a/src/core/hle/service/olsc/daemon_controller.h +++ b/src/core/hle/service/olsc/daemon_controller.h @@ -6,7 +6,8 @@ #pragma once -#include +#include +#include #include "common/uuid.h" #include "core/hle/service/cmif_types.h" @@ -56,10 +57,10 @@ private: } }; - ankerl::unordered_dense::map app_auto_transfer_{}; - ankerl::unordered_dense::map global_auto_upload_{}; - ankerl::unordered_dense::map global_auto_download_{}; - ankerl::unordered_dense::map autonomy_task_status_{}; + boost::container::unordered_flat_map app_auto_transfer_{}; + boost::container::unordered_flat_map global_auto_upload_{}; + boost::container::unordered_flat_map global_auto_download_{}; + boost::container::unordered_flat_map autonomy_task_status_{}; }; } // namespace Service::OLSC diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index e52a832a1e..7241ec4422 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include "common/common_types.h" #include "core/hle/service/hle_ipc.h" @@ -99,8 +100,8 @@ private: void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info); protected: - ankerl::unordered_dense::map handlers; - ankerl::unordered_dense::map handlers_tipc; + boost::container::unordered_flat_map handlers; + boost::container::unordered_flat_map handlers_tipc; /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. std::mutex lock_service; /// System context that the service operates under. diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index b566452ad7..438500b299 100644 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include "core/hle/kernel/k_port.h" @@ -100,8 +101,8 @@ private: /// Map of registered services, retrieved using GetServicePort. mutable std::mutex lock; - ankerl::unordered_dense::map registered_services; - ankerl::unordered_dense::map service_ports; + boost::container::unordered_flat_map registered_services; + boost::container::unordered_flat_map service_ports; /// Kernel context Kernel::KernelCore& kernel; diff --git a/src/core/hle/service/vi/conductor.h b/src/core/hle/service/vi/conductor.h index 7c93c230f7..02ef475c42 100644 --- a/src/core/hle/service/vi/conductor.h +++ b/src/core/hle/service/vi/conductor.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include "common/common_types.h" #include "common/polyfill_thread.h" @@ -49,7 +50,7 @@ private: private: Core::System& m_system; Container& m_container; - ankerl::unordered_dense::map m_vsync_managers; + boost::container::unordered_flat_map m_vsync_managers; std::shared_ptr m_event; Common::Event m_signal; std::jthread m_thread; diff --git a/src/core/launch_timestamp_cache.cpp b/src/core/launch_timestamp_cache.cpp index c58ffa1d5e..a5c052f4fc 100644 --- a/src/core/launch_timestamp_cache.cpp +++ b/src/core/launch_timestamp_cache.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include @@ -21,12 +21,9 @@ namespace Core::LaunchTimestampCache { namespace { -using CacheMap = ankerl::unordered_dense::map; -using CountMap = ankerl::unordered_dense::map; - std::mutex g_mutex; -CacheMap g_cache; -CountMap g_counts; +boost::container::flat_map g_cache; +boost::container::flat_map g_counts; bool g_loaded = false; std::filesystem::path GetCachePath() { diff --git a/src/dynarmic/CMakeLists.txt b/src/dynarmic/CMakeLists.txt index d733dc6a09..aaf619e458 100644 --- a/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/CMakeLists.txt @@ -120,8 +120,6 @@ if (NOT Boost_FOUND) endif() find_package(fmt 8 CONFIG) -find_package(unordered_dense REQUIRED) - if ("arm64" IN_LIST ARCHITECTURE OR DYNARMIC_TESTS) find_package(oaknut 2.0.1 CONFIG) endif() diff --git a/src/dynarmic/CMakeModules/dynarmicConfig.cmake.in b/src/dynarmic/CMakeModules/dynarmicConfig.cmake.in index ce14607c89..59bcddb3d3 100644 --- a/src/dynarmic/CMakeModules/dynarmicConfig.cmake.in +++ b/src/dynarmic/CMakeModules/dynarmicConfig.cmake.in @@ -8,8 +8,6 @@ if (NOT @BUILD_SHARED_LIBS@) find_dependency(Boost 1.57) find_dependency(fmt 9) find_dependency(mcl 0.1.12 EXACT) - find_dependency(unordered_dense) - if ("arm64" IN_LIST ARCHITECTURE) find_dependency(oaknut 2.0.1) endif() diff --git a/src/dynarmic/src/dynarmic/CMakeLists.txt b/src/dynarmic/src/dynarmic/CMakeLists.txt index ff5c4e7608..8628e8fc1d 100644 --- a/src/dynarmic/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/src/dynarmic/CMakeLists.txt @@ -386,8 +386,6 @@ set_target_properties(dynarmic PROPERTIES ) target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS}) - -target_link_libraries(dynarmic PRIVATE unordered_dense::unordered_dense) target_link_libraries(dynarmic PUBLIC fmt::fmt common) if (BOOST_NO_HEADERS) diff --git a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp index aa36119830..7c62c3aef4 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp @@ -75,7 +75,7 @@ CodePtr AddressSpace::GetOrEmit(IR::LocationDescriptor descriptor) { return block_info.entry_point; } -void AddressSpace::InvalidateBasicBlocks(const ankerl::unordered_dense::set& descriptors) { +void AddressSpace::InvalidateBasicBlocks(const boost::container::unordered_flat_set& descriptors) { UnprotectCodeMemory(); for (const auto& descriptor : descriptors) { diff --git a/src/dynarmic/src/dynarmic/backend/arm64/address_space.h b/src/dynarmic/src/dynarmic/backend/arm64/address_space.h index fba199aefb..bca7a3c286 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/address_space.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/address_space.h @@ -14,7 +14,8 @@ #include "common/common_types.h" #include #include -#include +#include +#include #include "dynarmic/backend/arm64/emit_arm64.h" #include "dynarmic/backend/arm64/fastmem.h" @@ -41,7 +42,7 @@ public: CodePtr GetOrEmit(IR::LocationDescriptor descriptor); - void InvalidateBasicBlocks(const ankerl::unordered_dense::set& descriptors); + void InvalidateBasicBlocks(const boost::container::unordered_flat_set& descriptors); void ClearCache(); protected: @@ -76,9 +77,9 @@ protected: // A IR::LocationDescriptor will have one current CodePtr. // However, there can be multiple other CodePtrs which are older, previously invalidated blocks. std::map reverse_block_entries; - ankerl::unordered_dense::map block_entries; - ankerl::unordered_dense::map block_infos; - ankerl::unordered_dense::map> block_references; + boost::container::unordered_flat_map block_entries; + boost::container::unordered_flat_map block_infos; + boost::container::unordered_flat_map> block_references; ExceptionHandler exception_handler; FastmemManager fastmem_manager; diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h index fefbcd8f5a..1c967ba899 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.h @@ -14,7 +14,8 @@ #include #include "common/common_types.h" -#include +#include +#include #include "dynarmic/backend/arm64/fastmem.h" #include "dynarmic/interface/A32/coprocessor.h" @@ -105,8 +106,8 @@ struct EmittedBlockInfo { CodePtr entry_point; std::size_t size; std::vector relocations; - ankerl::unordered_dense::map> block_relocations; - ankerl::unordered_dense::map fastmem_patch_info; + boost::container::unordered_flat_map> block_relocations; + boost::container::unordered_flat_map fastmem_patch_info; }; struct EmitConfig { diff --git a/src/dynarmic/src/dynarmic/backend/arm64/fastmem.h b/src/dynarmic/src/dynarmic/backend/arm64/fastmem.h index 83ce16d753..375c45f09a 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/fastmem.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/fastmem.h @@ -10,7 +10,8 @@ #include #include -#include +#include +#include #include "dynarmic/mcl/bit.hpp" #include "common/common_types.h" @@ -59,7 +60,7 @@ public: private: ExceptionHandler& exception_handler; - ankerl::unordered_dense::set do_not_fastmem; + boost::container::unordered_flat_set do_not_fastmem; }; } // namespace Dynarmic::Backend::Arm64 diff --git a/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.h b/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.h index af21cfbc25..67f66296c5 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.h @@ -18,7 +18,8 @@ #include "common/common_types.h" #include "dynarmic/mcl/is_instance_of_template.hpp" #include -#include +#include +#include #include "dynarmic/backend/arm64/stack_layout.h" #include "dynarmic/ir/cond.h" @@ -336,7 +337,7 @@ private: std::array spills; mutable std::size_t alloc_candidate_index = 0; - ankerl::unordered_dense::set defined_insts; + boost::container::unordered_flat_set defined_insts; }; template diff --git a/src/dynarmic/src/dynarmic/backend/block_range_information.cpp b/src/dynarmic/src/dynarmic/backend/block_range_information.cpp index bd7310194f..429597b0b2 100644 --- a/src/dynarmic/src/dynarmic/backend/block_range_information.cpp +++ b/src/dynarmic/src/dynarmic/backend/block_range_information.cpp @@ -11,13 +11,14 @@ #include #include #include "common/common_types.h" -#include +#include +#include namespace Dynarmic::Backend { template void BlockRangeInformation

::AddRange(boost::icl::discrete_interval

range, IR::LocationDescriptor location) { - block_ranges.add(std::make_pair(range, ankerl::unordered_dense::set{location})); + block_ranges.add(std::make_pair(range, boost::container::unordered_flat_set{location})); } template @@ -26,8 +27,8 @@ void BlockRangeInformation

::ClearCache() { } template -ankerl::unordered_dense::set BlockRangeInformation

::InvalidateRanges(const boost::icl::interval_set

& ranges) { - ankerl::unordered_dense::set erase_locations; +boost::container::unordered_flat_set BlockRangeInformation

::InvalidateRanges(const boost::icl::interval_set

& ranges) { + boost::container::unordered_flat_set erase_locations; for (auto invalidate_interval : ranges) { auto pair = block_ranges.equal_range(invalidate_interval); for (auto it = pair.first; it != pair.second; ++it) diff --git a/src/dynarmic/src/dynarmic/backend/block_range_information.h b/src/dynarmic/src/dynarmic/backend/block_range_information.h index 2af1a1120b..485a3d5912 100644 --- a/src/dynarmic/src/dynarmic/backend/block_range_information.h +++ b/src/dynarmic/src/dynarmic/backend/block_range_information.h @@ -12,7 +12,8 @@ #include #include -#include +#include +#include #include "dynarmic/ir/location_descriptor.h" @@ -23,8 +24,8 @@ class BlockRangeInformation { public: void AddRange(boost::icl::discrete_interval

range, IR::LocationDescriptor location); void ClearCache(); - ankerl::unordered_dense::set InvalidateRanges(const boost::icl::interval_set

& ranges); - boost::icl::interval_map> block_ranges; + boost::container::unordered_flat_set InvalidateRanges(const boost::icl::interval_set

& ranges); + boost::icl::interval_map> block_ranges; }; } // namespace Dynarmic::Backend diff --git a/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp b/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp index a64423581b..7dec104b5b 100644 --- a/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp +++ b/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp @@ -17,7 +17,8 @@ #include #include -#include +#include +#include #include #include @@ -55,7 +56,7 @@ class SigHandler { }); } - ankerl::unordered_dense::map code_block_infos; + boost::container::unordered_flat_map code_block_infos; std::shared_mutex code_block_infos_mutex; struct sigaction old_sa_segv; struct sigaction old_sa_bus; diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.h b/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.h index 55c4d8c5f3..52d73f03c3 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.h +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.h @@ -3,9 +3,8 @@ #pragma once +#include #include "dynarmic/backend/loongarch64/lagoon_cpp.h" -#include - #include "dynarmic/backend/loongarch64/code_block.h" #include "dynarmic/backend/loongarch64/emit_loongarch64.h" #include "dynarmic/interface/A32/config.h" @@ -53,8 +52,8 @@ private: const A32::UserConfig conf; CodeBlock cb; - ankerl::unordered_dense::map block_entries; - ankerl::unordered_dense::map block_infos; + boost::container::unordered_map block_entries; + boost::container::unordered_map block_infos; public: struct PreludeInfo { diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.h b/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.h index f3c5ff881b..ee3f3834bf 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.h +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.h @@ -9,7 +9,8 @@ #include #include "dynarmic/backend/loongarch64/lagoon_cpp.h" -#include +#include +#include #include "common/assert.h" #include "common/common_types.h" diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.h b/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.h index e882a9e2e6..a3239ebe83 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.h +++ b/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.h @@ -9,7 +9,8 @@ #pragma once #include -#include +#include +#include #include "dynarmic/backend/riscv64/code_block.h" #include "dynarmic/backend/riscv64/emit_riscv64.h" @@ -74,8 +75,8 @@ private: CodeBlock cb; biscuit::Assembler as; - ankerl::unordered_dense::map block_entries; - ankerl::unordered_dense::map block_infos; + boost::container::unordered_flat_map block_entries; + boost::container::unordered_flat_map block_infos; struct PreludeInfo { CodePtr end_of_prelude; diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.h b/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.h index 5a0bd660de..4509cde9ca 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.h +++ b/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.h @@ -19,7 +19,8 @@ #include "common/assert.h" #include "common/common_types.h" #include "dynarmic/mcl/is_instance_of_template.hpp" -#include +#include +#include #include "dynarmic/backend/riscv64/stack_layout.h" #include "dynarmic/ir/cond.h" diff --git a/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.h b/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.h index 31b1271800..010eddb293 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.h +++ b/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.h @@ -13,7 +13,8 @@ #include #include -#include +#include +#include #include "dynarmic/backend/block_range_information.h" #include "dynarmic/backend/x64/a32_jitstate.h" @@ -126,11 +127,11 @@ public: RegAlloc reg_alloc; //reusable reg alloc BlockRangeInformation block_ranges; std::array fast_dispatch_table; - ankerl::unordered_dense::map fastmem_patch_info; - ankerl::unordered_dense::map, void (*)()> read_fallbacks; - ankerl::unordered_dense::map, void (*)()> write_fallbacks; - ankerl::unordered_dense::map, void (*)()> exclusive_write_fallbacks; - ankerl::unordered_dense::set do_not_fastmem; + boost::container::unordered_flat_map fastmem_patch_info; + boost::container::unordered_flat_map, void (*)()> read_fallbacks; + boost::container::unordered_flat_map, void (*)()> write_fallbacks; + boost::container::unordered_flat_map, void (*)()> exclusive_write_fallbacks; + boost::container::unordered_flat_set do_not_fastmem; boost::container::stable_vector shared_labels; void (*memory_read_128)() = nullptr; // Dummy void (*memory_write_128)() = nullptr; // Dummy diff --git a/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.h b/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.h index 8800455813..0d5d09df5c 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.h +++ b/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.h @@ -12,7 +12,8 @@ #include #include #include -#include +#include +#include #include #include "dynarmic/backend/block_range_information.h" @@ -122,11 +123,11 @@ public: RegAlloc reg_alloc; //reusable reg alloc BlockRangeInformation block_ranges; std::array fast_dispatch_table; - ankerl::unordered_dense::map fastmem_patch_info; - ankerl::unordered_dense::map, void (*)()> read_fallbacks; - ankerl::unordered_dense::map, void (*)()> write_fallbacks; - ankerl::unordered_dense::map, void (*)()> exclusive_write_fallbacks; - ankerl::unordered_dense::set do_not_fastmem; + boost::container::unordered_flat_map fastmem_patch_info; + boost::container::unordered_flat_map, void (*)()> read_fallbacks; + boost::container::unordered_flat_map, void (*)()> write_fallbacks; + boost::container::unordered_flat_map, void (*)()> exclusive_write_fallbacks; + boost::container::unordered_flat_set do_not_fastmem; boost::container::stable_vector shared_labels; const void* terminal_handler_pop_rsb_hint = nullptr; const void* terminal_handler_fast_dispatch_hint = nullptr; diff --git a/src/dynarmic/src/dynarmic/backend/x64/constant_pool.h b/src/dynarmic/src/dynarmic/backend/x64/constant_pool.h index 36b2ac633e..275133b423 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/constant_pool.h +++ b/src/dynarmic/src/dynarmic/backend/x64/constant_pool.h @@ -14,7 +14,8 @@ #include #include "common/common_types.h" -#include +#include +#include #include "dynarmic/backend/x64/xbyak.h" namespace Dynarmic::Backend::X64 { @@ -43,7 +44,7 @@ private: } }; - ankerl::unordered_dense::map constant_info; + boost::container::unordered_flat_map constant_info; std::span pool; std::size_t insertion_point; }; diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp index 3d28365b1c..10f7397e51 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp @@ -14,7 +14,8 @@ #include #include "dynarmic/mcl/bit.hpp" #include "common/common_types.h" -#include +#include +#include #include "dynarmic/backend/x64/block_of_code.h" #include "dynarmic/backend/x64/nzcv_util.h" @@ -396,7 +397,7 @@ void EmitX64::ClearCache() { PerfMapClear(); } -void EmitX64::InvalidateBasicBlocks(const ankerl::unordered_dense::set& locations) { +void EmitX64::InvalidateBasicBlocks(const boost::container::unordered_flat_set& locations) { code.EnableWriting(); for (const auto& descriptor : locations) { if (auto const it = block_descriptors.find(descriptor); it != block_descriptors.end()) { diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64.h b/src/dynarmic/src/dynarmic/backend/x64/emit_x64.h index 11494c2d3e..c3f43bbb25 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64.h +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64.h @@ -16,7 +16,8 @@ #include #include -#include +#include +#include #include #include @@ -88,7 +89,7 @@ public: virtual void ClearCache(); /// Invalidates a selection of basic blocks. - void InvalidateBasicBlocks(const ankerl::unordered_dense::set& locations); + void InvalidateBasicBlocks(const boost::container::unordered_flat_set& locations); //protected: // Microinstruction emitters @@ -131,8 +132,8 @@ public: // State BlockOfCode& code; ExceptionHandler exception_handler; - ankerl::unordered_dense::map block_descriptors; - ankerl::unordered_dense::map patch_information; + boost::container::unordered_flat_map block_descriptors; + boost::container::unordered_flat_map patch_information; // We need materialized protected members friend class A64EmitX64; diff --git a/src/dynarmic/src/dynarmic/backend/x64/xbyak.h b/src/dynarmic/src/dynarmic/backend/x64/xbyak.h index 38401678e6..b08f42ac7e 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/xbyak.h +++ b/src/dynarmic/src/dynarmic/backend/x64/xbyak.h @@ -4,10 +4,11 @@ #pragma once // You must ensure this matches with src/common/x64/xbyak.h on root dir -#include +#include +#include #include -#define XBYAK_STD_UNORDERED_SET ankerl::unordered_dense::set -#define XBYAK_STD_UNORDERED_MAP ankerl::unordered_dense::map +#define XBYAK_STD_UNORDERED_SET boost::container::unordered_flat_set +#define XBYAK_STD_UNORDERED_MAP boost::container::unordered_flat_map #define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap #include #include diff --git a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp b/src/dynarmic/src/dynarmic/ir/opt_passes.cpp index 2b972cbdf4..bc7305c5ec 100644 --- a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp +++ b/src/dynarmic/src/dynarmic/ir/opt_passes.cpp @@ -11,7 +11,8 @@ #include #include -#include +#include +#include #include "boost/container/small_vector.hpp" #include "dynarmic/frontend/A32/a32_ir_emitter.h" #include "dynarmic/frontend/A32/a32_location_descriptor.h" @@ -1433,7 +1434,7 @@ static void VerificationPass(const IR::Block& block) { ASSERT(IR::AreTypesCompatible(t1, t2)); } } - ankerl::unordered_dense::map actual_uses; + boost::container::unordered_flat_map actual_uses; for (auto const& inst : block.instructions) { for (size_t i = 0; i < inst.NumArgs(); i++) if (IR::Value const arg = inst.GetArg(i); !arg.IsImmediate()) diff --git a/src/dynarmic/tests/A64/fibonacci.cpp b/src/dynarmic/tests/A64/fibonacci.cpp index 12c4170f66..ab54205917 100644 --- a/src/dynarmic/tests/A64/fibonacci.cpp +++ b/src/dynarmic/tests/A64/fibonacci.cpp @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -23,7 +24,7 @@ namespace { class MyEnvironment final : public A64::UserCallbacks { public: u64 ticks_left = 0; - ankerl::unordered_dense::map memory{}; + boost::container::unordered_flat_map memory{}; u8 MemoryRead8(u64 vaddr) override { return memory[vaddr]; diff --git a/src/dynarmic/tests/A64/testenv.h b/src/dynarmic/tests/A64/testenv.h index 1d260f5460..b099227e11 100644 --- a/src/dynarmic/tests/A64/testenv.h +++ b/src/dynarmic/tests/A64/testenv.h @@ -8,7 +8,8 @@ #pragma once -#include +#include +#include #include "common/assert.h" #include "common/common_types.h" #include "dynarmic/interface/A64/a64.h" @@ -17,7 +18,7 @@ using Vector = Dynarmic::A64::Vector; class A64TestEnv : public Dynarmic::A64::UserCallbacks { public: - ankerl::unordered_dense::map modified_memory; + boost::container::unordered_flat_map modified_memory; std::vector code_mem; u64 ticks_left = 0; u64 code_mem_start_address = 0; diff --git a/src/dynarmic/tests/CMakeLists.txt b/src/dynarmic/tests/CMakeLists.txt index ca44dce593..15a77e4b5c 100644 --- a/src/dynarmic/tests/CMakeLists.txt +++ b/src/dynarmic/tests/CMakeLists.txt @@ -24,7 +24,7 @@ add_executable(dynarmic_tests A64/real_world.cpp A64/testenv.h ) -target_link_libraries(dynarmic_tests PRIVATE merry::oaknut unordered_dense::unordered_dense) +target_link_libraries(dynarmic_tests PRIVATE merry::oaknut) if (DYNARMIC_TESTS_USE_UNICORN) target_link_libraries(dynarmic_tests PRIVATE Unicorn::Unicorn) @@ -72,7 +72,7 @@ add_executable(dynarmic_print_info print_info.cpp ) create_target_directory_groups(dynarmic_print_info) -target_link_libraries(dynarmic_print_info PRIVATE dynarmic fmt::fmt unordered_dense::unordered_dense) +target_link_libraries(dynarmic_print_info PRIVATE dynarmic fmt::fmt) if (BOOST_NO_HEADERS) target_link_libraries(dynarmic_print_info PRIVATE Boost::variant Boost::icl Boost::pool) else() @@ -93,7 +93,7 @@ add_executable(dynarmic_test_generator create_target_directory_groups(dynarmic_test_generator) -target_link_libraries(dynarmic_test_generator PRIVATE dynarmic fmt::fmt unordered_dense::unordered_dense) +target_link_libraries(dynarmic_test_generator PRIVATE dynarmic fmt::fmt) if (BOOST_NO_HEADERS) target_link_libraries(dynarmic_test_generator PRIVATE Boost::variant Boost::icl Boost::pool) else() @@ -110,7 +110,7 @@ add_executable(dynarmic_test_reader test_reader.cpp ) create_target_directory_groups(dynarmic_test_reader) -target_link_libraries(dynarmic_test_reader PRIVATE dynarmic fmt::fmt unordered_dense::unordered_dense) +target_link_libraries(dynarmic_test_reader PRIVATE dynarmic fmt::fmt) if (BOOST_NO_HEADERS) target_link_libraries(dynarmic_test_reader PRIVATE Boost::variant Boost::icl Boost::pool) else() @@ -123,7 +123,7 @@ target_compile_definitions(dynarmic_test_reader PRIVATE FMT_USE_USER_DEFINED_LIT # create_target_directory_groups(dynarmic_tests) -target_link_libraries(dynarmic_tests PRIVATE dynarmic Catch2::Catch2WithMain fmt::fmt unordered_dense::unordered_dense) +target_link_libraries(dynarmic_tests PRIVATE dynarmic Catch2::Catch2WithMain fmt::fmt) if (BOOST_NO_HEADERS) target_link_libraries(dynarmic_tests PRIVATE Boost::variant Boost::icl Boost::pool) else() diff --git a/src/hid_core/frontend/emulated_console.h b/src/hid_core/frontend/emulated_console.h index b8ce45f05c..71b9f70e62 100644 --- a/src/hid_core/frontend/emulated_console.h +++ b/src/hid_core/frontend/emulated_console.h @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include "common/common_funcs.h" #include "common/common_types.h" @@ -185,7 +186,7 @@ private: mutable std::mutex mutex; mutable std::mutex callback_mutex; - ankerl::unordered_dense::map callback_list; + boost::container::unordered_flat_map callback_list; int last_callback_key = 0; // Stores the current status of all console input diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index bee8fb8b3e..2be97b6871 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h @@ -14,7 +14,8 @@ #include #include -#include +#include +#include #include "common/common_types.h" #include "common/input.h" @@ -636,7 +637,7 @@ private: ControllerMotionDevices virtual_motion_devices; mutable std::mutex callback_mutex; - ankerl::unordered_dense::map callback_list; + boost::container::unordered_flat_map callback_list; int last_callback_key = 0; // Stores the current status of all controller input diff --git a/src/hid_core/frontend/emulated_devices.h b/src/hid_core/frontend/emulated_devices.h index fb6c982a70..27b9409b37 100644 --- a/src/hid_core/frontend/emulated_devices.h +++ b/src/hid_core/frontend/emulated_devices.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -205,7 +206,7 @@ private: mutable std::mutex mutex; mutable std::mutex callback_mutex; - ankerl::unordered_dense::map callback_list; + boost::container::unordered_flat_map callback_list; int last_callback_key = 0; // Stores the current status of all external device input diff --git a/src/input_common/drivers/android.h b/src/input_common/drivers/android.h index 18678de602..e89b77fa96 100644 --- a/src/input_common/drivers/android.h +++ b/src/input_common/drivers/android.h @@ -90,7 +90,7 @@ public: Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override; private: - ankerl::unordered_dense::map input_devices; + boost::container::unordered_flat_map input_devices; /// Returns the correct identifier corresponding to the player index PadIdentifier GetIdentifier(const std::string& guid, size_t port) const; diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index dd7e8edc30..af49e0f32a 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -732,7 +732,7 @@ SDLDriver::~SDLDriver() { std::vector SDLDriver::GetInputDevices() const { std::vector devices; - ankerl::unordered_dense::map> joycon_pairs; + boost::container::unordered_flat_map> joycon_pairs; for (const auto& [key, value] : joystick_map) { for (const auto& joystick : value) { if (!joystick->GetSDLJoystick()) { diff --git a/src/input_common/drivers/sdl_driver.h b/src/input_common/drivers/sdl_driver.h index bf4a45e83d..3351f8f823 100644 --- a/src/input_common/drivers/sdl_driver.h +++ b/src/input_common/drivers/sdl_driver.h @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include @@ -117,7 +118,7 @@ private: Common::SPSCQueue vibration_queue; /// Map of GUID of a list of corresponding virtual Joysticks - ankerl::unordered_dense::map>> joystick_map; + boost::container::unordered_flat_map>> joystick_map; std::mutex joystick_map_mutex; bool start_thread = false; diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h index 7ad40027e4..94fbe256e1 100644 --- a/src/input_common/input_engine.h +++ b/src/input_common/input_engine.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include "common/common_types.h" #include "common/input.h" @@ -270,10 +270,10 @@ protected: private: struct ControllerData { - ankerl::unordered_dense::map buttons; - ankerl::unordered_dense::map hat_buttons; - ankerl::unordered_dense::map axes; - ankerl::unordered_dense::map motions; + boost::container::flat_map buttons; + boost::container::flat_map hat_buttons; + boost::container::flat_map axes; + boost::container::flat_map motions; Common::Input::BatteryLevel battery{}; Common::Input::BodyColorStatus color{}; Common::Input::CameraStatus camera{}; @@ -301,8 +301,8 @@ private: bool configuring{false}; const std::string input_engine; int last_callback_key = 0; - ankerl::unordered_dense::map controller_list; - ankerl::unordered_dense::map callback_list; + boost::container::unordered_flat_map controller_list; + boost::container::unordered_flat_map callback_list; MappingCallback mapping_callback; }; diff --git a/src/input_common/main.h b/src/input_common/main.h index d0e447ec2d..f4d7901c8b 100644 --- a/src/input_common/main.h +++ b/src/input_common/main.h @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include namespace Common { @@ -56,9 +57,9 @@ enum class InputType { None, Button, Stick, Motion, Touch }; * Given a ParamPackage for a Device returned from `GetInputDevices`, attempt to get the default * mapping for the device. */ -using AnalogMapping = ankerl::unordered_dense::map; -using ButtonMapping = ankerl::unordered_dense::map; -using MotionMapping = ankerl::unordered_dense::map; +using AnalogMapping = boost::container::unordered_flat_map; +using ButtonMapping = boost::container::unordered_flat_map; +using MotionMapping = boost::container::unordered_flat_map; class InputSubsystem { public: diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index fb20966b67..bbee927102 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -9,7 +9,8 @@ #include #include -#include +#include +#include #include "shader_recompiler/backend/bindings.h" #include "shader_recompiler/frontend/ir/program.h" @@ -370,7 +371,7 @@ public: Id load_const_func_u32x4{}; // Sirit::Id doesn't play nice with *::set<> - ankerl::unordered_dense::set non_uniform_ids; + boost::container::unordered_flat_set non_uniform_ids; bool uses_nonuniform_sampled_image{}; bool uses_nonuniform_storage_image{}; diff --git a/src/shader_recompiler/environment.h b/src/shader_recompiler/environment.h index 20381cf467..fe055d3f62 100644 --- a/src/shader_recompiler/environment.h +++ b/src/shader_recompiler/environment.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include "common/common_types.h" #include "shader_recompiler/program_header.h" @@ -126,9 +127,9 @@ protected: u32 start_address{}; bool is_proprietary_driver{}; public: - ankerl::unordered_dense::map cbuf_word_cache; - ankerl::unordered_dense::map handle_cache; - ankerl::unordered_dense::map track_cache; + boost::container::unordered_flat_map cbuf_word_cache; + boost::container::unordered_flat_map handle_cache; + boost::container::unordered_flat_map track_cache; }; } // namespace Shader diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp index 74d5b0872e..091a050cc3 100644 --- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp @@ -7,7 +7,8 @@ #include #include #include -#include +#include +#include #include #include @@ -390,7 +391,7 @@ private: std::optional return_label) { Statement* const false_stmt{pool.Create(Identity{}, IR::Condition{false}, &root_stmt)}; Tree& root{root_stmt.children}; - ankerl::unordered_dense::map local_labels; + boost::container::unordered_flat_map local_labels; local_labels.reserve(function.blocks.size()); for (Flow::Block& block : function.blocks) { diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp index 2bde38a661..438560d898 100644 --- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp +++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp @@ -19,7 +19,8 @@ #include #include #include -#include +#include +#include #include #include diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index 0d0144fcab..fdd2ea8e53 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -7,7 +7,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/src/tests/common/fibers.cpp b/src/tests/common/fibers.cpp index ce17a5c52c..aeae711d38 100644 --- a/src/tests/common/fibers.cpp +++ b/src/tests/common/fibers.cpp @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include @@ -39,7 +40,7 @@ public: private: mutable std::mutex mutex; - ankerl::unordered_dense::map ids; + boost::container::unordered_flat_map ids; }; class TestControl1 { diff --git a/src/tests/video_core/memory_tracker.cpp b/src/tests/video_core/memory_tracker.cpp index 5fd8037446..4762e5f9b0 100644 --- a/src/tests/video_core/memory_tracker.cpp +++ b/src/tests/video_core/memory_tracker.cpp @@ -3,7 +3,8 @@ #include #include -#include +#include +#include #include #include #include @@ -65,7 +66,7 @@ public: } private: - ankerl::unordered_dense::map page_table; + boost::container::unordered_flat_map page_table; std::vector> calls; size_t update_calls = 0; }; diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 14ab3e6ebc..0c4e9301bf 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h @@ -16,7 +16,8 @@ #include #include -#include +#include +#include #include #include diff --git a/src/video_core/buffer_cache/memory_tracker_base.h b/src/video_core/buffer_cache/memory_tracker_base.h index 2c571271d6..8519448eba 100644 --- a/src/video_core/buffer_cache/memory_tracker_base.h +++ b/src/video_core/buffer_cache/memory_tracker_base.h @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include "common/alignment.h" @@ -257,7 +258,7 @@ private: std::array top_tier{}; std::deque> manager_pool; std::deque free_managers; - ankerl::unordered_dense::set cached_pages; + boost::container::unordered_flat_set cached_pages; DeviceTracker* device_tracker = nullptr; }; diff --git a/src/video_core/control/channel_state_cache.h b/src/video_core/control/channel_state_cache.h index f8b8abcac6..6026a2dd80 100644 --- a/src/video_core/control/channel_state_cache.h +++ b/src/video_core/control/channel_state_cache.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -88,14 +89,14 @@ protected: std::deque

channel_storage; std::deque free_channel_ids; - ankerl::unordered_dense::map channel_map; + boost::container::unordered_flat_map channel_map; std::vector active_channel_ids; struct AddressSpaceRef { size_t ref_count; size_t storage_id; Tegra::MemoryManager* gpu_memory; }; - ankerl::unordered_dense::map address_spaces; + boost::container::unordered_flat_map address_spaces; mutable std::mutex config_mutex; virtual void OnGPUASRegister([[maybe_unused]] size_t map_id) {} diff --git a/src/video_core/control/scheduler.h b/src/video_core/control/scheduler.h index fb9c583386..e58a64b49d 100644 --- a/src/video_core/control/scheduler.h +++ b/src/video_core/control/scheduler.h @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include "video_core/dma_pusher.h" @@ -27,7 +28,7 @@ public: void DeclareChannel(std::shared_ptr new_channel); private: - ankerl::unordered_dense::map> channels; + boost::container::unordered_flat_map> channels; std::mutex scheduling_guard; }; diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index f09cf24ed3..e24e8a596a 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -3111,7 +3111,7 @@ public: void SetHLEReplacementAttributeType(u32 bank, u32 offset, HLEReplacementAttributeType name); - ankerl::unordered_dense::map replace_table; + boost::container::unordered_flat_map replace_table; static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Maxwell3D Regs has wrong size"); static_assert(std::is_trivially_copyable_v, "Maxwell3D Regs must be trivially copyable"); diff --git a/src/video_core/engines/sw_blitter/converter.cpp b/src/video_core/engines/sw_blitter/converter.cpp index 6682c96444..e72832e1f8 100644 --- a/src/video_core/engines/sw_blitter/converter.cpp +++ b/src/video_core/engines/sw_blitter/converter.cpp @@ -7,7 +7,8 @@ #include #include #include -#include +#include +#include #include #include #include "common/assert.h" @@ -924,7 +925,7 @@ public: }; struct ConverterFactory::ConverterFactoryImpl { - ankerl::unordered_dense::map> converters_cache; + boost::container::unordered_flat_map> converters_cache; }; ConverterFactory::ConverterFactory() { diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index dbc7d43553..f3fc855b43 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -333,7 +333,7 @@ struct GPU::Impl { std::unique_ptr cpu_context; Tegra::Control::Scheduler scheduler; - ankerl::unordered_dense::map> channels; + boost::container::unordered_flat_map> channels; Tegra::Control::ChannelState* current_channel; s32 bound_channel{-1}; diff --git a/src/video_core/gpu_logging/gpu_logging.h b/src/video_core/gpu_logging/gpu_logging.h index b16988ed0b..efffb457a8 100644 --- a/src/video_core/gpu_logging/gpu_logging.h +++ b/src/video_core/gpu_logging/gpu_logging.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -152,7 +153,7 @@ private: mutable std::mutex ring_buffer_mutex; // Memory tracking - ankerl::unordered_dense::map memory_allocations; + boost::container::unordered_flat_map memory_allocations; mutable std::mutex memory_mutex; // Statistics diff --git a/src/video_core/host1x/codecs/decoder.h b/src/video_core/host1x/codecs/decoder.h index 2cc6d8dce6..bfa776a5be 100644 --- a/src/video_core/host1x/codecs/decoder.h +++ b/src/video_core/host1x/codecs/decoder.h @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" diff --git a/src/video_core/host1x/host1x.h b/src/video_core/host1x/host1x.h index 592ec449e8..7eff26b795 100644 --- a/src/video_core/host1x/host1x.h +++ b/src/video_core/host1x/host1x.h @@ -6,7 +6,8 @@ #pragma once -#include +#include +#include #include #include @@ -118,7 +119,7 @@ private: } std::mutex m_mutex{}; - ankerl::unordered_dense::map m_frame_devices; + boost::container::unordered_flat_map m_frame_devices; static constexpr size_t MAX_PRESENT_QUEUE = 100; static constexpr size_t MAX_DECODE_MAP = 200; diff --git a/src/video_core/macro.h b/src/video_core/macro.h index 43b32ed920..320ee2e77a 100644 --- a/src/video_core/macro.h +++ b/src/video_core/macro.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include "common/bit_field.h" #include "common/common_types.h" @@ -237,8 +238,8 @@ struct MacroEngine { AnyCachedMacro program; u64 hash{}; }; - ankerl::unordered_dense::map macro_cache; - ankerl::unordered_dense::map> uploaded_macro_code; + boost::container::unordered_flat_map macro_cache; + boost::container::unordered_flat_map> uploaded_macro_code; bool is_interpreted; }; diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index ebb87fe65a..232b1d5bc8 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h @@ -15,7 +15,8 @@ #include #include #include -#include +#include +#include #include #include "common/assert.h" @@ -350,7 +351,7 @@ private: mutable std::recursive_mutex mutex; - ankerl::unordered_dense::map> cached_queries; + boost::container::unordered_flat_map> cached_queries; std::array streams; diff --git a/src/video_core/query_cache/query_cache.h b/src/video_core/query_cache/query_cache.h index 50b662e0ad..bd41f7e7a3 100644 --- a/src/video_core/query_cache/query_cache.h +++ b/src/video_core/query_cache/query_cache.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include "common/assert.h" diff --git a/src/video_core/query_cache/query_cache_base.h b/src/video_core/query_cache/query_cache_base.h index 242e24388f..71eae45c74 100644 --- a/src/video_core/query_cache/query_cache_base.h +++ b/src/video_core/query_cache/query_cache_base.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include "common/assert.h" @@ -160,7 +161,7 @@ protected: } } - using ContentCache = ankerl::unordered_dense::map>; + using ContentCache = boost::container::unordered_flat_map>; void InvalidateQuery(QueryLocation location); bool IsQueryDirty(QueryLocation location); @@ -168,7 +169,7 @@ protected: void RequestGuestHostSync(); void UnregisterPending(); - ankerl::unordered_dense::map> cached_queries; + boost::container::unordered_flat_map> cached_queries; std::mutex cache_mutex; struct QueryCacheBaseImpl; diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h index a0acfc48c1..c21b039958 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.h +++ b/src/video_core/renderer_opengl/gl_buffer_cache.h @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include "common/common_types.h" #include "video_core/buffer_cache/buffer_cache_base.h" @@ -242,7 +243,7 @@ private: u32 index_buffer_offset = 0; u64 device_access_memory; - ankerl::unordered_dense::map tfb_objects; + boost::container::unordered_flat_map tfb_objects; }; struct BufferCacheParams { diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 02e54539fc..b15597efdc 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include "common/common_types.h" #include "common/thread_worker.h" @@ -81,8 +82,8 @@ private: GraphicsPipeline* current_pipeline{}; ShaderContext::ShaderPools main_pools; - ankerl::unordered_dense::map> graphics_cache; - ankerl::unordered_dense::map> compute_cache; + boost::container::unordered_flat_map> graphics_cache; + boost::container::unordered_flat_map> compute_cache; Shader::Profile profile; Shader::HostTranslateInfo host_info; diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 8aed499bb7..1b9c1ca577 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -159,7 +159,7 @@ private: UtilShaders util_shaders; FormatConversionPass format_conversion_pass; - std::array, 3> format_properties; + std::array, 3> format_properties; bool has_broken_texture_view_formats = false; OGLTexture null_image_1d_array; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index 9d66b663f5..9c49f8a475 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -163,8 +164,8 @@ private: GraphicsPipelineCacheKey graphics_key{}; GraphicsPipeline* current_pipeline{}; - ankerl::unordered_dense::map> compute_cache; - ankerl::unordered_dense::map> graphics_cache; + boost::container::unordered_flat_map> compute_cache; + boost::container::unordered_flat_map> graphics_cache; ShaderPools main_pools; diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index a12dc00771..4337fc532f 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include #include "video_core/renderer_vulkan/vk_texture_cache.h" @@ -246,7 +247,7 @@ public: sync_values_stash.emplace_back(); std::vector* sync_values = &sync_values_stash.back(); sync_values->reserve(num_slots_used); - ankerl::unordered_dense::map> offsets; + boost::container::unordered_flat_map> offsets; resolve_buffers.clear(); size_t resolve_buffer_index = ObtainBuffer(num_slots_used); resolve_buffers.push_back(resolve_buffer_index); @@ -428,7 +429,7 @@ private: template void ApplyBanksWideOp(std::vector& queries, Func&& func) { std::conditional_t>, - ankerl::unordered_dense::map>> + boost::container::unordered_flat_map>> indexer; for (auto q : queries) { auto* query = GetQuery(q); @@ -757,7 +758,7 @@ public: void SyncWrites() override { CloseCounter(); - ankerl::unordered_dense::map> sync_values_stash; + boost::container::unordered_flat_map> sync_values_stash; for (auto q : pending_sync) { auto* query = GetQuery(q); if (True(query->flags & VideoCommon::QueryFlagBits::IsRewritten)) { diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp index 1846f1b3cc..dd2f07bf76 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.cpp @@ -4,7 +4,8 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include +#include +#include #include diff --git a/src/video_core/renderer_vulkan/vk_render_pass_cache.h b/src/video_core/renderer_vulkan/vk_render_pass_cache.h index f9923be75a..2770a5ea36 100644 --- a/src/video_core/renderer_vulkan/vk_render_pass_cache.h +++ b/src/video_core/renderer_vulkan/vk_render_pass_cache.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include "common/container_hash.h" #include "video_core/surface.h" @@ -75,7 +76,7 @@ public: private: const Device* device{}; - ankerl::unordered_dense::map cache; + boost::container::unordered_flat_map cache; std::mutex mutex; }; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 1b1e35aa45..d538983621 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -186,7 +186,7 @@ public: }; std::vector msaa_scratch_images; - ankerl::unordered_dense::map resolve_shadows; + boost::container::unordered_flat_map resolve_shadows; std::vector> pending_resolve_shadows; }; diff --git a/src/video_core/shader_cache.h b/src/video_core/shader_cache.h index 7d93a542ef..df0ef80380 100644 --- a/src/video_core/shader_cache.h +++ b/src/video_core/shader_cache.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include @@ -148,8 +149,8 @@ private: mutable std::mutex lookup_mutex; std::mutex invalidation_mutex; - ankerl::unordered_dense::map> lookup_cache; - ankerl::unordered_dense::map> invalidation_cache; + boost::container::unordered_flat_map> lookup_cache; + boost::container::unordered_flat_map> invalidation_cache; std::vector> storage; std::vector marked_for_removal; }; diff --git a/src/video_core/shader_environment.h b/src/video_core/shader_environment.h index 95c6d72f89..e68c74e0c1 100644 --- a/src/video_core/shader_environment.h +++ b/src/video_core/shader_environment.h @@ -14,7 +14,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -79,10 +80,10 @@ protected: GPUVAddr program_base{}; std::vector code; - ankerl::unordered_dense::map texture_types; - ankerl::unordered_dense::map texture_pixel_formats; - ankerl::unordered_dense::map cbuf_values; - ankerl::unordered_dense::map cbuf_replacements; + boost::container::unordered_flat_map texture_types; + boost::container::unordered_flat_map texture_pixel_formats; + boost::container::unordered_flat_map cbuf_values; + boost::container::unordered_flat_map cbuf_replacements; u32 local_memory_size{}; u32 texture_bound{}; @@ -201,10 +202,10 @@ public: private: std::vector code; - ankerl::unordered_dense::map texture_types; - ankerl::unordered_dense::map texture_pixel_formats; - ankerl::unordered_dense::map cbuf_values; - ankerl::unordered_dense::map cbuf_replacements; + boost::container::unordered_flat_map texture_types; + boost::container::unordered_flat_map texture_pixel_formats; + boost::container::unordered_flat_map cbuf_values; + boost::container::unordered_flat_map cbuf_replacements; std::array workgroup_size{}; u32 local_memory_size{}; u32 shared_memory_size{}; diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index b6a37286a0..295f5f65b8 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include "common/alignment.h" @@ -2190,7 +2191,7 @@ void TextureCache

::UnregisterImage(ImageId image_id) { image.flags &= ~ImageFlagBits::BadOverlap; lru_cache.Free(image.lru_index); const auto& clear_page_table = - [image_id](u64 page, ankerl::unordered_dense::map, Common::IdentityHash>& selected_page_table) { + [image_id](u64 page, boost::container::unordered_flat_map, Common::IdentityHash>& selected_page_table) { const auto page_it = selected_page_table.find(page); if (page_it == selected_page_table.end()) { ASSERT_MSG(false, "Unregistering unregistered page={:#x}", page << YUZU_PAGEBITS); diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index d143c1ef72..e0c8d29ad7 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -14,7 +14,8 @@ #include // TODO: find out which don't require stable iters #include -#include +#include +#include #include #include #include @@ -68,7 +69,7 @@ struct AsyncDecodeContext { std::atomic_bool complete; }; -using TextureCacheGPUMap = ankerl::unordered_dense::map, Common::IdentityHash>; +using TextureCacheGPUMap = boost::container::unordered_flat_map, Common::IdentityHash>; class TextureCacheChannelInfo : public ChannelInfo { public: @@ -86,8 +87,8 @@ public: std::unordered_map image_views; std::unordered_map samplers; - ankerl::unordered_dense::map sampler_ids; - ankerl::unordered_dense::map image_view_ids; + boost::container::unordered_flat_map sampler_ids; + boost::container::unordered_flat_map image_view_ids; TextureCacheGPUMap* gpu_page_table = nullptr; TextureCacheGPUMap* sparse_page_table = nullptr; @@ -441,9 +442,9 @@ private: FramebufferId last_framebuffer_id{}; u64 last_framebuffer_serial = 0; - ankerl::unordered_dense::map framebuffers; - ankerl::unordered_dense::map, Common::IdentityHash> page_table; - ankerl::unordered_dense::map> sparse_views; + boost::container::unordered_flat_map framebuffers; + boost::container::unordered_flat_map, Common::IdentityHash> page_table; + boost::container::unordered_flat_map> sparse_views; DAddr virtual_invalid_space{}; @@ -499,7 +500,7 @@ private: DelayedDestructionRing sentenced_image_view; DelayedDestructionRing sentenced_framebuffers; - ankerl::unordered_dense::map image_allocs_table; + boost::container::unordered_flat_map image_allocs_table; Common::ScratchBuffer swizzle_data_buffer; Common::ScratchBuffer unswizzle_data_buffer; @@ -516,17 +517,17 @@ private: // Join caching boost::container::small_vector join_overlap_ids; - ankerl::unordered_dense::set join_overlaps_found; + boost::container::unordered_flat_set join_overlaps_found; boost::container::small_vector join_left_aliased_ids; boost::container::small_vector join_right_aliased_ids; - ankerl::unordered_dense::set join_ignore_textures; + boost::container::unordered_flat_set join_ignore_textures; boost::container::small_vector join_bad_overlap_ids; struct JoinCopy { bool is_alias; ImageId id; }; boost::container::small_vector join_copies_to_do; - ankerl::unordered_dense::map join_alias_indices; + boost::container::unordered_flat_map join_alias_indices; }; } // namespace VideoCommon diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index b2cfd2c01d..f36f72a5a6 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include @@ -157,7 +158,7 @@ VkFormatFeatureFlags GetFormatFeatures(VkFormatProperties properties, FormatType } } -ankerl::unordered_dense::map GetFormatProperties(vk::PhysicalDevice physical) { +boost::container::unordered_flat_map GetFormatProperties(vk::PhysicalDevice physical) { static constexpr std::array formats{ VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A2B10G10R10_SINT_PACK32, @@ -309,7 +310,7 @@ ankerl::unordered_dense::map GetFormatProperties(v VK_FORMAT_EAC_R11G11_UNORM_BLOCK, VK_FORMAT_EAC_R11G11_SNORM_BLOCK, }; - ankerl::unordered_dense::map format_properties; + boost::container::unordered_flat_map format_properties; for (const auto format : formats) { format_properties.emplace(format, physical.GetFormatProperties(format)); } @@ -317,7 +318,7 @@ ankerl::unordered_dense::map GetFormatProperties(v } #if defined(__ANDROID__) && defined(ARCHITECTURE_arm64) -void OverrideBcnFormats(ankerl::unordered_dense::map& format_properties) { +void OverrideBcnFormats(boost::container::unordered_flat_map& format_properties) { // These properties are extracted from Adreno driver 512.687.0 constexpr VkFormatFeatureFlags tiling_features{VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_BLIT_SRC_BIT | @@ -1676,7 +1677,7 @@ void Device::CollectToolingInfo() { std::vector Device::GetDeviceQueueCreateInfos() const { static constexpr float QUEUE_PRIORITY = 1.0f; - ankerl::unordered_dense::set unique_queue_families{graphics_family, present_family}; + boost::container::unordered_flat_set unique_queue_families{graphics_family, present_family}; std::vector queue_cis; queue_cis.reserve(unique_queue_families.size()); diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 319a7b2ec3..17fc642522 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include "common/common_types.h" @@ -1241,7 +1242,7 @@ private: std::vector valid_heap_memory; ///< Heaps used. /// Format properties dictionary. - ankerl::unordered_dense::map format_properties; + boost::container::unordered_flat_map format_properties; /// Nsight Aftermath GPU crash tracker std::unique_ptr nsight_aftermath_tracker; diff --git a/src/yuzu/configuration/input_profiles.h b/src/yuzu/configuration/input_profiles.h index 326e7f9a1d..0e4b88e6ab 100644 --- a/src/yuzu/configuration/input_profiles.h +++ b/src/yuzu/configuration/input_profiles.h @@ -7,7 +7,8 @@ #pragma once #include -#include +#include +#include #include "qt_common/config/qt_config.h" @@ -35,5 +36,5 @@ public: private: bool ProfileExistsInMap(const std::string& profile_name) const; - ankerl::unordered_dense::map> map_profiles; + boost::container::unordered_flat_map> map_profiles; }; diff --git a/src/yuzu/loading_screen.cpp b/src/yuzu/loading_screen.cpp index d67667a91d..4d2d05c1ce 100644 --- a/src/yuzu/loading_screen.cpp +++ b/src/yuzu/loading_screen.cpp @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include #include "core/frontend/framebuffer_layout.h" #include "core/loader/loader.h" #include "ui_loading_screen.h" diff --git a/src/yuzu/loading_screen.h b/src/yuzu/loading_screen.h index a39d5f6605..982e7e8918 100644 --- a/src/yuzu/loading_screen.h +++ b/src/yuzu/loading_screen.h @@ -80,8 +80,8 @@ private: std::unique_ptr fadeout_animation; // Definitions for the differences in text and styling for each stage - ankerl::unordered_dense::map progressbar_style; - ankerl::unordered_dense::map stage_translations; + boost::container::unordered_flat_map progressbar_style; + boost::container::unordered_flat_map stage_translations; // newly generated shaders are added to the end of the file, so when loading and compiling // shaders, it will start quickly but end slow if new shaders were added since previous launch. diff --git a/src/yuzu/multiplayer/chat_room.h b/src/yuzu/multiplayer/chat_room.h index 44ec8952d1..0f8b79c33e 100644 --- a/src/yuzu/multiplayer/chat_room.h +++ b/src/yuzu/multiplayer/chat_room.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include "network/network.h" namespace Ui { @@ -65,8 +66,8 @@ private: bool has_mod_perms = false; QStandardItemModel* player_list; std::unique_ptr ui; - ankerl::unordered_dense::set block_list; - ankerl::unordered_dense::map icon_cache; + boost::container::unordered_flat_set block_list; + boost::container::unordered_flat_map icon_cache; }; Q_DECLARE_METATYPE(Network::ChatEntry);