Compare commits

...

2 Commits

Author SHA1 Message Date
lizzie e114e9e083 me when sed goes wrong 2026-08-30 08:27:22 +00:00
lizzie 9d5861e830 [*] nuke unordered-dense, use boost::container::unordered_flat_{map,set}
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-08-30 08:15:47 +00:00
115 changed files with 350 additions and 347 deletions
@@ -1,26 +0,0 @@
From b3622608433c183ba868a1dc8dd9cf285eb3b916 Mon Sep 17 00:00:00 2001
From: Dario Petrillo <dario.pk1@gmail.com>
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<is_map_v<T>, base_table_type_map<T>, bas
// modifiers //////////////////////////////////////////////////////////////
void clear() {
- m_values.clear();
- clear_buckets();
+ if (!empty()) {
+ m_values.clear();
+ clear_buckets();
+ }
}
auto insert(value_type const& value) -> std::pair<iterator, bool> {
-1
View File
@@ -540,7 +540,6 @@ add_subdirectory(externals)
# pass targets from externals # pass targets from externals
# TODO(crueter): CPMUtil Propagate func? # TODO(crueter): CPMUtil Propagate func?
find_package(enet) find_package(enet)
find_package(unordered_dense REQUIRED)
if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)
find_package(xbyak) find_package(xbyak)
-11
View File
@@ -301,17 +301,6 @@
"repo": "eden-emu/tzdb_to_nx", "repo": "eden-emu/tzdb_to_nx",
"version": "230326" "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": { "vulkan-headers": {
"hash": "d2846ea228415772645eea4b52a9efd33e6a563043dd3de059e798be6391a8f0ca089f455ae420ff22574939ed0f48ed7c6ff3d5a9987d5231dbf3b3f89b484b", "hash": "d2846ea228415772645eea4b52a9efd33e6a563043dd3de059e798be6391a8f0ca089f455ae420ff22574939ed0f48ed7c6ff3d5a9987d5231dbf3b3f89b484b",
"min_version": "1.4.317", "min_version": "1.4.317",
+4 -5
View File
@@ -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 * [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. * 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 * [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: On amd64:
@@ -119,7 +118,7 @@ Now, install all deps:
sudo emerge -a \ sudo emerge -a \
app-arch/lz4 app-arch/zstd app-arch/unzip \ app-arch/lz4 app-arch/zstd app-arch/unzip \
dev-libs/libfmt dev-libs/libusb dev-libs/mcl dev-libs/sirit \ 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/spirv-tools dev-util/spirv-headers dev-util/vulkan-headers \
dev-util/vulkan-utility-libraries dev-util/glslang \ dev-util/vulkan-utility-libraries dev-util/glslang \
media-gfx/renderdoc media-libs/libva media-libs/opus media-video/ffmpeg \ media-gfx/renderdoc media-libs/libva media-libs/opus media-video/ffmpeg \
@@ -260,7 +259,7 @@ brew install molten-vk
<details> <details>
<summary>FreeBSD</summary> <summary>FreeBSD</summary>
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. 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
<summary>DragonFlyBSD</summary> <summary>DragonFlyBSD</summary>
```sh ```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). [Caveats](./Caveats.md#dragonflybsd).
@@ -328,7 +327,7 @@ sudo pkgin install git cmake autoconf build-essential libusb-1 nasm gcc13
```sh ```sh
BASE="git make autoconf libtool automake-wrapper jq patch" 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) # Either x86_64 or clang-aarch64 (Windows on ARM)
packages="$BASE" packages="$BASE"
for pkg in $MINGW; do for pkg in $MINGW; do
-25
View File
@@ -308,31 +308,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. 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 ### xbyak
-3
View File
@@ -58,9 +58,6 @@ if (WIN32 AND NOT TARGET LLVM::Demangle)
add_library(LLVM::Demangle ALIAS demangle) add_library(LLVM::Demangle ALIAS demangle)
endif() endif()
# unordered_dense
AddJsonPackage(unordered-dense)
# httplib # httplib
if (IOS) if (IOS)
set(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF) set(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF)
@@ -20,7 +20,7 @@ struct RomMetadata {
std::vector<u8> icon; std::vector<u8> icon;
bool isHomebrew; bool isHomebrew;
}; };
static ankerl::unordered_dense::map<std::string, RomMetadata> m_rom_metadata_cache; static boost::unordered::unordered_flat_map<std::string, RomMetadata> m_rom_metadata_cache;
static RomMetadata CacheRomMetadata(const std::string& path) { static RomMetadata CacheRomMetadata(const std::string& path) {
auto& instance = EmulationSession::GetInstance(); auto& instance = EmulationSession::GetInstance();
@@ -21,7 +21,7 @@
#include "input_common/drivers/virtual_gamepad.h" #include "input_common/drivers/virtual_gamepad.h"
#include "native.h" #include "native.h"
ankerl::unordered_dense::map<std::string, std::unique_ptr<AndroidConfig>> map_profiles; boost::unordered::unordered_flat_map<std::string, std::unique_ptr<AndroidConfig>> map_profiles;
bool IsHandheldOnly() { bool IsHandheldOnly() {
const auto npad_style_set = const auto npad_style_set =
+1 -1
View File
@@ -241,7 +241,7 @@ if (lz4_ADDED)
target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib) target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib)
endif() 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) target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd)
# Please refer to src/common/demangle.cpp # Please refer to src/common/demangle.cpp
+4 -3
View File
@@ -7,7 +7,8 @@
#include <algorithm> #include <algorithm>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/assert.h" #include "common/assert.h"
#include "common/fs/fs.h" #include "common/fs/fs.h"
@@ -196,8 +197,8 @@ private:
SetLegacyPathImpl(legacy_path, new_path); SetLegacyPathImpl(legacy_path, new_path);
} }
ankerl::unordered_dense::map<EdenPath, fs::path> eden_paths; boost::unordered::unordered_flat_map<EdenPath, fs::path> eden_paths;
ankerl::unordered_dense::map<EmuPath, fs::path> legacy_paths; boost::unordered::unordered_flat_map<EmuPath, fs::path> legacy_paths;
}; };
bool ValidatePath(const fs::path& path) { bool ValidatePath(const fs::path& path) {
+3 -2
View File
@@ -7,7 +7,8 @@
#ifdef _WIN32 #ifdef _WIN32
#include <iterator> #include <iterator>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <boost/icl/separate_interval_set.hpp> #include <boost/icl/separate_interval_set.hpp>
#include <windows.h> #include <windows.h>
#include "common/dynamic_library.h" #include "common/dynamic_library.h"
@@ -391,7 +392,7 @@ private:
std::mutex placeholder_mutex; ///< Mutex for placeholders std::mutex placeholder_mutex; ///< Mutex for placeholders
boost::icl::separate_interval_set<size_t> placeholders; ///< Mapped placeholders boost::icl::separate_interval_set<size_t> placeholders; ///< Mapped placeholders
ankerl::unordered_dense::map<size_t, size_t> placeholder_host_pointers; ///< Placeholder backing offset boost::unordered::unordered_flat_map<size_t, size_t> placeholder_host_pointers; ///< Placeholder backing offset
}; };
#elif defined(__OPENORBIS__) || defined(__managarm__) #elif defined(__OPENORBIS__) || defined(__managarm__)
+3 -2
View File
@@ -9,7 +9,8 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "common/logging.h" #include "common/logging.h"
@@ -412,7 +413,7 @@ public:
namespace Impl { namespace Impl {
template <typename InputDeviceType> template <typename InputDeviceType>
using FactoryListType = ankerl::unordered_dense::map<std::string, std::shared_ptr<Factory<InputDeviceType>>>; using FactoryListType = boost::unordered::unordered_flat_map<std::string, std::shared_ptr<Factory<InputDeviceType>>>;
template <typename InputDeviceType> template <typename InputDeviceType>
struct FactoryList { struct FactoryList {
+3 -2
View File
@@ -8,14 +8,15 @@
#include <initializer_list> #include <initializer_list>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
namespace Common { namespace Common {
/// A string-based key-value container supporting serializing to and deserializing from a string /// A string-based key-value container supporting serializing to and deserializing from a string
class ParamPackage { class ParamPackage {
public: public:
using DataType = ankerl::unordered_dense::map<std::string, std::string>; using DataType = boost::unordered::unordered_flat_map<std::string, std::string>;
ParamPackage() = default; ParamPackage() = default;
explicit ParamPackage(const std::string& serialized); explicit ParamPackage(const std::string& serialized);
+4 -3
View File
@@ -22,10 +22,11 @@
#endif #endif
// You must ensure this matches with src/common/x64/xbyak.h on root dir // You must ensure this matches with src/common/x64/xbyak.h on root dir
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#define XBYAK_STD_UNORDERED_SET ankerl::unordered_dense::set #define XBYAK_STD_UNORDERED_SET boost::unordered::unordered_flat_set
#define XBYAK_STD_UNORDERED_MAP ankerl::unordered_dense::map #define XBYAK_STD_UNORDERED_MAP boost::unordered::unordered_flat_map
#define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap #define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap
#include <xbyak/xbyak.h> #include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h> #include <xbyak/xbyak_util.h>
+2 -1
View File
@@ -8,7 +8,8 @@
#include <atomic> #include <atomic>
#include <memory> #include <memory>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <dynarmic/interface/A64/a64.h> #include <dynarmic/interface/A64/a64.h>
#include <dynarmic/interface/code_page.h> #include <dynarmic/interface/code_page.h>
+2 -2
View File
@@ -4,7 +4,7 @@
#pragma once #pragma once
#include <span> #include <span>
#include <ankerl/unordered_dense.h> #include <boost/container/flat_map.hpp>
#include <vector> #include <vector>
#include <oaknut/code_block.hpp> #include <oaknut/code_block.hpp>
#include <oaknut/oaknut.hpp> #include <oaknut/oaknut.hpp>
@@ -46,7 +46,7 @@ enum class PatchMode : u32 {
using ModuleTextAddress = u64; using ModuleTextAddress = u64;
using PatchTextAddress = u64; using PatchTextAddress = u64;
using EntryTrampolines = ankerl::unordered_dense::map<ModuleTextAddress, PatchTextAddress>; using EntryTrampolines = boost::container::flat_map<ModuleTextAddress, PatchTextAddress>;
class Patcher { class Patcher {
public: public:
+3 -2
View File
@@ -8,7 +8,8 @@
#include <utility> #include <utility>
#include <span> #include <span>
#include <cctype> #include <cctype>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/hex_util.h" #include "common/hex_util.h"
#include "common/logging.h" #include "common/logging.h"
@@ -104,7 +105,7 @@ struct IPSwitchRecord {
size_t count; size_t count;
}; };
struct IPSwitchCompiler::IPSwitchPatch { struct IPSwitchCompiler::IPSwitchPatch {
ankerl::unordered_dense::map<u32, IPSwitchRecord> records; boost::unordered::unordered_flat_map<u32, IPSwitchRecord> records;
bool enabled; bool enabled;
}; };
+1 -1
View File
@@ -566,7 +566,7 @@ VirtualFile RegisteredCache::GetFileAtID(NcaID id) const {
return file; return file;
} }
static std::optional<NcaID> CheckMapForContentRecord(const ankerl::unordered_dense::map<u64, CNMT>& map, u64 title_id, ContentRecordType type) { static std::optional<NcaID> CheckMapForContentRecord(const boost::unordered::unordered_flat_map<u64, CNMT>& map, u64 title_id, ContentRecordType type) {
auto cmnt_iter = map.find(title_id); auto cmnt_iter = map.find(title_id);
u8 id_offset = 0; u8 id_offset = 0;
+5 -6
View File
@@ -12,7 +12,6 @@
#include <optional> #include <optional>
#include <string> #include <string>
#include <vector> #include <vector>
#include <ankerl/unordered_dense.h>
#include <boost/container/flat_map.hpp> #include <boost/container/flat_map.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/crypto/key_manager.h" #include "core/crypto/key_manager.h"
@@ -209,11 +208,11 @@ private:
ContentProviderParsingFunction parser; ContentProviderParsingFunction parser;
// maps tid -> NcaID of meta // maps tid -> NcaID of meta
ankerl::unordered_dense::map<u64, NcaID> meta_id; boost::container::flat_map<u64, NcaID> meta_id;
// maps tid -> meta // maps tid -> meta
ankerl::unordered_dense::map<u64, CNMT> meta; boost::container::flat_map<u64, CNMT> meta;
// maps tid -> meta for CNMT in yuzu_meta // maps tid -> meta for CNMT in yuzu_meta
ankerl::unordered_dense::map<u64, CNMT> yuzu_meta; boost::container::flat_map<u64, CNMT> yuzu_meta;
}; };
enum class ContentProviderUnionSlot { enum class ContentProviderUnionSlot {
@@ -313,8 +312,8 @@ private:
void ProcessXCI(const VirtualFile& file); void ProcessXCI(const VirtualFile& file);
std::vector<VirtualDir> load_dirs; std::vector<VirtualDir> load_dirs;
ankerl::unordered_dense::map<std::tuple<u64, ContentRecordType, TitleType>, VirtualFile> entries; boost::container::flat_map<std::tuple<u64, ContentRecordType, TitleType>, VirtualFile> entries;
ankerl::unordered_dense::map<u64, u32> versions; boost::container::flat_map<u64, u32> versions;
std::vector<ExternalUpdateEntry> multi_version_entries; std::vector<ExternalUpdateEntry> multi_version_entries;
}; };
+3 -6
View File
@@ -4,9 +4,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm> #include <boost/container/flat_set.hpp>
#include <set>
#include <ankerl/unordered_dense.h>
#include <utility> #include <utility>
#include "core/file_sys/vfs/vfs_layered.h" #include "core/file_sys/vfs/vfs_layered.h"
@@ -63,7 +61,7 @@ std::string LayeredVfsDirectory::GetFullPath() const {
std::vector<VirtualFile> LayeredVfsDirectory::GetFiles() const { std::vector<VirtualFile> LayeredVfsDirectory::GetFiles() const {
std::vector<VirtualFile> out; std::vector<VirtualFile> out;
ankerl::unordered_dense::set<std::string> out_names; boost::container::flat_set<std::string> out_names;
for (const auto& layer : dirs) { for (const auto& layer : dirs) {
for (auto& file : layer->GetFiles()) { for (auto& file : layer->GetFiles()) {
@@ -79,8 +77,7 @@ std::vector<VirtualFile> LayeredVfsDirectory::GetFiles() const {
std::vector<VirtualDir> LayeredVfsDirectory::GetSubdirectories() const { std::vector<VirtualDir> LayeredVfsDirectory::GetSubdirectories() const {
std::vector<VirtualDir> out; std::vector<VirtualDir> out;
ankerl::unordered_dense::set<std::string> out_names; boost::container::flat_set<std::string> out_names;
for (const auto& layer : dirs) { for (const auto& layer : dirs) {
for (const auto& sd : layer->GetSubdirectories()) { for (const auto& sd : layer->GetSubdirectories()) {
out_names.emplace(sd->GetName()); out_names.emplace(sd->GetName());
+2 -2
View File
@@ -78,7 +78,7 @@ private:
std::array<DebugWatchpoint, Core::Hardware::NUM_WATCHPOINTS> m_watchpoints{}; std::array<DebugWatchpoint, Core::Hardware::NUM_WATCHPOINTS> m_watchpoints{};
std::map<KProcessAddress, u64> m_debug_page_refcounts{}; std::map<KProcessAddress, u64> m_debug_page_refcounts{};
#ifdef HAS_NCE #ifdef HAS_NCE
ankerl::unordered_dense::map<u64, u64> m_post_handlers{}; boost::unordered::unordered_flat_map<u64, u64> m_post_handlers{};
#endif #endif
std::unique_ptr<Core::ExclusiveMonitor> m_exclusive_monitor; std::unique_ptr<Core::ExclusiveMonitor> m_exclusive_monitor;
Core::Memory::Memory m_memory; Core::Memory::Memory m_memory;
@@ -494,7 +494,7 @@ public:
static void Switch(KernelCore& kernel, KProcess* cur_process, KProcess* next_process); static void Switch(KernelCore& kernel, KProcess* cur_process, KProcess* next_process);
#ifdef HAS_NCE #ifdef HAS_NCE
ankerl::unordered_dense::map<u64, u64>& GetPostHandlers() noexcept { boost::unordered::unordered_flat_map<u64, u64>& GetPostHandlers() noexcept {
return m_post_handlers; return m_post_handlers;
} }
#endif #endif
+4 -3
View File
@@ -10,7 +10,8 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <thread> #include <thread>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <utility> #include <utility>
#include "common/assert.h" #include "common/assert.h"
@@ -792,8 +793,8 @@ struct KernelCore::Impl {
std::optional<KObjectNameGlobalData> object_name_global_data; std::optional<KObjectNameGlobalData> object_name_global_data;
ankerl::unordered_dense::set<KAutoObject*> registered_objects; boost::unordered::unordered_flat_set<KAutoObject*> registered_objects;
ankerl::unordered_dense::set<KAutoObject*> registered_in_use_objects; boost::unordered::unordered_flat_set<KAutoObject*> registered_in_use_objects;
std::mutex server_lock; std::mutex server_lock;
std::vector<std::unique_ptr<Service::ServerManager>> server_managers; std::vector<std::unique_ptr<Service::ServerManager>> server_managers;
+2 -1
View File
@@ -11,7 +11,8 @@
#include <list> #include <list>
#include <memory> #include <memory>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/polyfill_thread.h" #include "common/polyfill_thread.h"
@@ -7,7 +7,8 @@
#pragma once #pragma once
#include <array> #include <array>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/common_funcs.h" #include "common/common_funcs.h"
@@ -176,6 +177,6 @@ struct WebCommonReturnValue {
}; };
static_assert(sizeof(WebCommonReturnValue) == 0x1010, "WebCommonReturnValue has incorrect size."); static_assert(sizeof(WebCommonReturnValue) == 0x1010, "WebCommonReturnValue has incorrect size.");
using WebArgInputTLVMap = ankerl::unordered_dense::map<WebArgInputTLVType, std::vector<u8>>; using WebArgInputTLVMap = boost::unordered::unordered_flat_map<WebArgInputTLVType, std::vector<u8>>;
} // namespace Service::AM::Frontend } // namespace Service::AM::Frontend
@@ -40,8 +40,8 @@ std::vector<u8> default_logo_small;
std::vector<u8> default_logo_large; std::vector<u8> default_logo_large;
bool default_logos_loaded = false; bool default_logos_loaded = false;
ankerl::unordered_dense::map<std::string, std::vector<u8>> news_images_small; boost::unordered::unordered_flat_map<std::string, std::vector<u8>> news_images_small;
ankerl::unordered_dense::map<std::string, std::vector<u8>> news_images_large; boost::unordered::unordered_flat_map<std::string, std::vector<u8>> news_images_large;
std::mutex images_mutex; std::mutex images_mutex;
@@ -12,7 +12,8 @@
#include <optional> #include <optional>
#include <span> #include <span>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
@@ -93,7 +94,7 @@ private:
static s64 Now(); static s64 Now();
mutable std::mutex mtx; mutable std::mutex mtx;
ankerl::unordered_dense::map<std::string, StoredNews> items; boost::unordered::unordered_flat_map<std::string, StoredNews> items;
size_t open_counter{}; size_t open_counter{};
}; };
+3 -2
View File
@@ -6,7 +6,8 @@
#pragma once #pragma once
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/fs/fs.h" #include "common/fs/fs.h"
#include "core/hle/result.h" #include "core/hle/result.h"
@@ -88,7 +89,7 @@ private:
AlbumFileDateTime ConvertToAlbumDateTime(u64 posix_time) const; AlbumFileDateTime ConvertToAlbumDateTime(u64 posix_time) const;
bool is_mounted{}; bool is_mounted{};
ankerl::unordered_dense::map<AlbumFileId, std::filesystem::path> album_files; boost::unordered::unordered_flat_map<AlbumFileId, std::filesystem::path> album_files;
Core::System& system; Core::System& system;
}; };
+3 -2
View File
@@ -15,7 +15,8 @@
#include <random> #include <random>
#include <span> #include <span>
#include <thread> #include <thread>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/logging.h" #include "common/logging.h"
#include "common/socket_types.h" #include "common/socket_types.h"
@@ -119,7 +120,7 @@ protected:
std::array<LanStation, StationCountMax> stations; std::array<LanStation, StationCountMax> stations;
std::array<NodeLatestUpdate, NodeCountMax> node_changes{}; std::array<NodeLatestUpdate, NodeCountMax> node_changes{};
std::array<u8, NodeCountMax> node_last_states{}; std::array<u8, NodeCountMax> node_last_states{};
ankerl::unordered_dense::map<MacAddress, NetworkInfo, MACAddressHash> scan_results{}; boost::unordered::unordered_flat_map<MacAddress, NetworkInfo, MACAddressHash> scan_results{};
NodeInfo node_info{}; NodeInfo node_info{};
NetworkInfo network_info{}; NetworkInfo network_info{};
State state{State::None}; State state{State::None};
+3 -2
View File
@@ -7,7 +7,8 @@
#include <string> #include <string>
#include <optional> #include <optional>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <boost/container_hash/hash.hpp> #include <boost/container_hash/hash.hpp>
#include "common/logging.h" #include "common/logging.h"
#include "core/core.h" #include "core/core.h"
@@ -331,7 +332,7 @@ private:
}; };
static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size"); static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size");
ankerl::unordered_dense::map<LogPacketHeaderEntry, std::vector<u8>> entries{}; boost::unordered::unordered_flat_map<LogPacketHeaderEntry, std::vector<u8>> entries{};
LogDestination destination{LogDestination::All}; LogDestination destination{LogDestination::All};
}; };
+2 -1
View File
@@ -23,7 +23,8 @@
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <thread> #include <thread>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <common/settings.h> #include <common/settings.h>
#ifdef _WIN32 #ifdef _WIN32
+2 -1
View File
@@ -9,7 +9,8 @@
#include <deque> #include <deque>
#include <memory> #include <memory>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "core/device_memory_manager.h" #include "core/device_memory_manager.h"
#include "core/hle/service/nvdrv/nvdata.h" #include "core/hle/service/nvdrv/nvdata.h"
+3 -2
View File
@@ -12,7 +12,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <assert.h> #include <assert.h>
#include "common/bit_field.h" #include "common/bit_field.h"
@@ -161,7 +162,7 @@ private:
std::list<std::shared_ptr<Handle>> unmap_queue{}; std::list<std::shared_ptr<Handle>> unmap_queue{};
std::mutex unmap_queue_lock{}; //!< Protects access to `unmap_queue` std::mutex unmap_queue_lock{}; //!< Protects access to `unmap_queue`
ankerl::unordered_dense::map<Handle::Id, std::shared_ptr<Handle>> boost::unordered::unordered_flat_map<Handle::Id, std::shared_ptr<Handle>>
handles{}; //!< Main owning map of handles handles{}; //!< Main owning map of handles
std::mutex handles_lock; //!< Protects access to `handles` std::mutex handles_lock; //!< Protects access to `handles`
@@ -13,7 +13,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/address_space.h" #include "common/address_space.h"
@@ -113,7 +114,7 @@ private:
}; };
static_assert(sizeof(IoctlRemapEntry) == 20, "IoctlRemapEntry is incorrect size"); static_assert(sizeof(IoctlRemapEntry) == 20, "IoctlRemapEntry is incorrect size");
ankerl::unordered_dense::set<s64_le> map_buffer_offsets{}; boost::unordered::unordered_flat_set<s64_le> map_buffer_offsets{};
struct IoctlMapBufferEx { struct IoctlMapBufferEx {
MappingFlags flags{}; // bit0: fixed_offset, bit2: cacheable MappingFlags flags{}; // bit0: fixed_offset, bit2: cacheable
@@ -217,7 +217,7 @@ private:
NvCore::SyncpointManager& syncpoint_manager; NvCore::SyncpointManager& syncpoint_manager;
NvCore::NvMap& nvmap; NvCore::NvMap& nvmap;
std::shared_ptr<Tegra::Control::ChannelState> channel_state; std::shared_ptr<Tegra::Control::ChannelState> channel_state;
ankerl::unordered_dense::map<DeviceFD, NvCore::SessionId> sessions; boost::unordered::unordered_flat_map<DeviceFD, NvCore::SessionId> sessions;
u32 channel_syncpoint; u32 channel_syncpoint;
std::mutex channel_mutex; std::mutex channel_mutex;
@@ -7,7 +7,8 @@
#pragma once #pragma once
#include <deque> #include <deque>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
@@ -138,7 +139,7 @@ protected:
NvCore::NvMap& nvmap; NvCore::NvMap& nvmap;
NvCore::ChannelType channel_type; NvCore::ChannelType channel_type;
std::array<u32, MaxSyncPoints> device_syncpoints{}; std::array<u32, MaxSyncPoints> device_syncpoints{};
ankerl::unordered_dense::map<DeviceFD, NvCore::SessionId> sessions; boost::unordered::unordered_flat_map<DeviceFD, NvCore::SessionId> sessions;
}; };
}; // namespace Devices }; // namespace Devices
} // namespace Service::Nvidia } // namespace Service::Nvidia
+3 -2
View File
@@ -7,7 +7,8 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
@@ -118,7 +119,7 @@ private:
NvCore::Container& container; NvCore::Container& container;
NvCore::NvMap& file; NvCore::NvMap& file;
ankerl::unordered_dense::map<DeviceFD, NvCore::SessionId> sessions; boost::unordered::unordered_flat_map<DeviceFD, NvCore::SessionId> sessions;
}; };
} // namespace Service::Nvidia::Devices } // namespace Service::Nvidia::Devices
+4 -3
View File
@@ -12,7 +12,8 @@
#include <memory> #include <memory>
#include <span> #include <span>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/service/kernel_helpers.h" #include "core/hle/service/kernel_helpers.h"
@@ -103,7 +104,7 @@ private:
/// Id to use for the next open file descriptor. /// Id to use for the next open file descriptor.
DeviceFD next_fd = 1; DeviceFD next_fd = 1;
using FilesContainerType = ankerl::unordered_dense::map<DeviceFD, std::shared_ptr<Devices::nvdevice>>; using FilesContainerType = boost::unordered::unordered_flat_map<DeviceFD, std::shared_ptr<Devices::nvdevice>>;
/// Mapping of file descriptors to the devices they reference. /// Mapping of file descriptors to the devices they reference.
FilesContainerType open_files; FilesContainerType open_files;
@@ -111,7 +112,7 @@ private:
EventInterface events_interface; EventInterface events_interface;
ankerl::unordered_dense::map<std::string, std::function<FilesContainerType::iterator(DeviceFD)>> builders; boost::unordered::unordered_flat_map<std::string, std::function<FilesContainerType::iterator(DeviceFD)>> builders;
}; };
void LoopProcess(Core::System& system); void LoopProcess(Core::System& system);
@@ -8,7 +8,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/service/nvnflinger/binder.h" #include "core/hle/service/nvnflinger/binder.h"
@@ -39,8 +40,8 @@ private:
mutable std::mutex lock; mutable std::mutex lock;
s32 last_id = 0; s32 last_id = 0;
ankerl::unordered_dense::map<s32, std::shared_ptr<android::IBinder>> binders; boost::unordered::unordered_flat_map<s32, std::shared_ptr<android::IBinder>> binders;
ankerl::unordered_dense::map<s32, RefCounts> refcounts; boost::unordered::unordered_flat_map<s32, RefCounts> refcounts;
}; };
} // namespace Service::Nvnflinger } // namespace Service::Nvnflinger
@@ -6,7 +6,8 @@
#pragma once #pragma once
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/uuid.h" #include "common/uuid.h"
#include "core/hle/service/cmif_types.h" #include "core/hle/service/cmif_types.h"
@@ -56,10 +57,10 @@ private:
} }
}; };
ankerl::unordered_dense::map<AppKey, bool, AppKeyHash> app_auto_transfer_{}; boost::unordered::unordered_flat_map<AppKey, bool, AppKeyHash> app_auto_transfer_{};
ankerl::unordered_dense::map<Common::UUID, bool> global_auto_upload_{}; boost::unordered::unordered_flat_map<Common::UUID, bool> global_auto_upload_{};
ankerl::unordered_dense::map<Common::UUID, bool> global_auto_download_{}; boost::unordered::unordered_flat_map<Common::UUID, bool> global_auto_download_{};
ankerl::unordered_dense::map<AppKey, u8, AppKeyHash> autonomy_task_status_{}; boost::unordered::unordered_flat_map<AppKey, u8, AppKeyHash> autonomy_task_status_{};
}; };
} // namespace Service::OLSC } // namespace Service::OLSC
+4 -3
View File
@@ -8,7 +8,8 @@
#include <cstddef> #include <cstddef>
#include <mutex> #include <mutex>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/service/hle_ipc.h" #include "core/hle/service/hle_ipc.h"
@@ -99,8 +100,8 @@ private:
void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info); void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info);
protected: protected:
ankerl::unordered_dense::map<u32, FunctionInfoBase> handlers; boost::unordered::unordered_flat_map<u32, FunctionInfoBase> handlers;
ankerl::unordered_dense::map<u32, FunctionInfoBase> handlers_tipc; boost::unordered::unordered_flat_map<u32, FunctionInfoBase> handlers_tipc;
/// Used to gain exclusive access to the service members, e.g. from CoreTiming thread. /// Used to gain exclusive access to the service members, e.g. from CoreTiming thread.
std::mutex lock_service; std::mutex lock_service;
/// System context that the service operates under. /// System context that the service operates under.
+4 -3
View File
@@ -10,7 +10,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <concepts> #include <concepts>
#include "core/hle/kernel/k_port.h" #include "core/hle/kernel/k_port.h"
@@ -100,8 +101,8 @@ private:
/// Map of registered services, retrieved using GetServicePort. /// Map of registered services, retrieved using GetServicePort.
mutable std::mutex lock; mutable std::mutex lock;
ankerl::unordered_dense::map<std::string, SessionRequestHandlerFactory> registered_services; boost::unordered::unordered_flat_map<std::string, SessionRequestHandlerFactory> registered_services;
ankerl::unordered_dense::map<std::string, Kernel::KClientPort*> service_ports; boost::unordered::unordered_flat_map<std::string, Kernel::KClientPort*> service_ports;
/// Kernel context /// Kernel context
Kernel::KernelCore& kernel; Kernel::KernelCore& kernel;
+3 -2
View File
@@ -7,7 +7,8 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/polyfill_thread.h" #include "common/polyfill_thread.h"
@@ -49,7 +50,7 @@ private:
private: private:
Core::System& m_system; Core::System& m_system;
Container& m_container; Container& m_container;
ankerl::unordered_dense::map<u64, VsyncManager> m_vsync_managers; boost::unordered::unordered_flat_map<u64, VsyncManager> m_vsync_managers;
std::shared_ptr<Core::Timing::EventType> m_event; std::shared_ptr<Core::Timing::EventType> m_event;
Common::Event m_signal; Common::Event m_signal;
std::jthread m_thread; std::jthread m_thread;
+3 -6
View File
@@ -8,7 +8,7 @@
#include <mutex> #include <mutex>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/container/flat_map.hpp>
#include <fmt/format.h> #include <fmt/format.h>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
@@ -21,12 +21,9 @@
namespace Core::LaunchTimestampCache { namespace Core::LaunchTimestampCache {
namespace { namespace {
using CacheMap = ankerl::unordered_dense::map<u64, s64>;
using CountMap = ankerl::unordered_dense::map<u64, u64>;
std::mutex g_mutex; std::mutex g_mutex;
CacheMap g_cache; boost::container::flat_map<u64, s64> g_cache;
CountMap g_counts; boost::container::flat_map<u64, u64> g_counts;
bool g_loaded = false; bool g_loaded = false;
std::filesystem::path GetCachePath() { std::filesystem::path GetCachePath() {
-2
View File
@@ -120,8 +120,6 @@ if (NOT Boost_FOUND)
endif() endif()
find_package(fmt 8 CONFIG) find_package(fmt 8 CONFIG)
find_package(unordered_dense REQUIRED)
if ("arm64" IN_LIST ARCHITECTURE OR DYNARMIC_TESTS) if ("arm64" IN_LIST ARCHITECTURE OR DYNARMIC_TESTS)
find_package(oaknut 2.0.1 CONFIG) find_package(oaknut 2.0.1 CONFIG)
endif() endif()
@@ -8,8 +8,6 @@ if (NOT @BUILD_SHARED_LIBS@)
find_dependency(Boost 1.57) find_dependency(Boost 1.57)
find_dependency(fmt 9) find_dependency(fmt 9)
find_dependency(mcl 0.1.12 EXACT) find_dependency(mcl 0.1.12 EXACT)
find_dependency(unordered_dense)
if ("arm64" IN_LIST ARCHITECTURE) if ("arm64" IN_LIST ARCHITECTURE)
find_dependency(oaknut 2.0.1) find_dependency(oaknut 2.0.1)
endif() endif()
-2
View File
@@ -386,8 +386,6 @@ set_target_properties(dynarmic PROPERTIES
) )
target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS}) 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) target_link_libraries(dynarmic PUBLIC fmt::fmt common)
if (BOOST_NO_HEADERS) if (BOOST_NO_HEADERS)
@@ -75,7 +75,7 @@ CodePtr AddressSpace::GetOrEmit(IR::LocationDescriptor descriptor) {
return block_info.entry_point; return block_info.entry_point;
} }
void AddressSpace::InvalidateBasicBlocks(const ankerl::unordered_dense::set<IR::LocationDescriptor>& descriptors) { void AddressSpace::InvalidateBasicBlocks(const boost::unordered::unordered_flat_set<IR::LocationDescriptor>& descriptors) {
UnprotectCodeMemory(); UnprotectCodeMemory();
for (const auto& descriptor : descriptors) { for (const auto& descriptor : descriptors) {
@@ -14,7 +14,8 @@
#include "common/common_types.h" #include "common/common_types.h"
#include <oaknut/code_block.hpp> #include <oaknut/code_block.hpp>
#include <oaknut/oaknut.hpp> #include <oaknut/oaknut.hpp>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/arm64/emit_arm64.h" #include "dynarmic/backend/arm64/emit_arm64.h"
#include "dynarmic/backend/arm64/fastmem.h" #include "dynarmic/backend/arm64/fastmem.h"
@@ -41,7 +42,7 @@ public:
CodePtr GetOrEmit(IR::LocationDescriptor descriptor); CodePtr GetOrEmit(IR::LocationDescriptor descriptor);
void InvalidateBasicBlocks(const ankerl::unordered_dense::set<IR::LocationDescriptor>& descriptors); void InvalidateBasicBlocks(const boost::unordered::unordered_flat_set<IR::LocationDescriptor>& descriptors);
void ClearCache(); void ClearCache();
protected: protected:
@@ -76,9 +77,9 @@ protected:
// A IR::LocationDescriptor will have one current CodePtr. // A IR::LocationDescriptor will have one current CodePtr.
// However, there can be multiple other CodePtrs which are older, previously invalidated blocks. // However, there can be multiple other CodePtrs which are older, previously invalidated blocks.
std::map<CodePtr, IR::LocationDescriptor> reverse_block_entries; std::map<CodePtr, IR::LocationDescriptor> reverse_block_entries;
ankerl::unordered_dense::map<IR::LocationDescriptor, CodePtr> block_entries; boost::unordered::unordered_flat_map<IR::LocationDescriptor, CodePtr> block_entries;
ankerl::unordered_dense::map<CodePtr, EmittedBlockInfo> block_infos; boost::unordered::unordered_flat_map<CodePtr, EmittedBlockInfo> block_infos;
ankerl::unordered_dense::map<IR::LocationDescriptor, ankerl::unordered_dense::set<CodePtr>> block_references; boost::unordered::unordered_flat_map<IR::LocationDescriptor, boost::unordered::unordered_flat_set<CodePtr>> block_references;
ExceptionHandler exception_handler; ExceptionHandler exception_handler;
FastmemManager fastmem_manager; FastmemManager fastmem_manager;
@@ -14,7 +14,8 @@
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/arm64/fastmem.h" #include "dynarmic/backend/arm64/fastmem.h"
#include "dynarmic/interface/A32/coprocessor.h" #include "dynarmic/interface/A32/coprocessor.h"
@@ -105,8 +106,8 @@ struct EmittedBlockInfo {
CodePtr entry_point; CodePtr entry_point;
std::size_t size; std::size_t size;
std::vector<Relocation> relocations; std::vector<Relocation> relocations;
ankerl::unordered_dense::map<IR::LocationDescriptor, std::vector<BlockRelocation>> block_relocations; boost::unordered::unordered_flat_map<IR::LocationDescriptor, std::vector<BlockRelocation>> block_relocations;
ankerl::unordered_dense::map<std::ptrdiff_t, FastmemPatchInfo> fastmem_patch_info; boost::unordered::unordered_flat_map<std::ptrdiff_t, FastmemPatchInfo> fastmem_patch_info;
}; };
struct EmitConfig { struct EmitConfig {
@@ -10,7 +10,8 @@
#include <cstddef> #include <cstddef>
#include <tuple> #include <tuple>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/mcl/bit.hpp" #include "dynarmic/mcl/bit.hpp"
#include "common/common_types.h" #include "common/common_types.h"
@@ -59,7 +60,7 @@ public:
private: private:
ExceptionHandler& exception_handler; ExceptionHandler& exception_handler;
ankerl::unordered_dense::set<DoNotFastmemMarker, DoNotFastmemMarkerHash> do_not_fastmem; boost::unordered::unordered_flat_set<DoNotFastmemMarker, DoNotFastmemMarkerHash> do_not_fastmem;
}; };
} // namespace Dynarmic::Backend::Arm64 } // namespace Dynarmic::Backend::Arm64
@@ -18,7 +18,8 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "dynarmic/mcl/is_instance_of_template.hpp" #include "dynarmic/mcl/is_instance_of_template.hpp"
#include <oaknut/oaknut.hpp> #include <oaknut/oaknut.hpp>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/arm64/stack_layout.h" #include "dynarmic/backend/arm64/stack_layout.h"
#include "dynarmic/ir/cond.h" #include "dynarmic/ir/cond.h"
@@ -336,7 +337,7 @@ private:
std::array<HostLocInfo, SpillCount> spills; std::array<HostLocInfo, SpillCount> spills;
mutable std::size_t alloc_candidate_index = 0; mutable std::size_t alloc_candidate_index = 0;
ankerl::unordered_dense::set<const IR::Inst*> defined_insts; boost::unordered::unordered_flat_set<const IR::Inst*> defined_insts;
}; };
template<typename T> template<typename T>
@@ -11,13 +11,14 @@
#include <boost/icl/interval_map.hpp> #include <boost/icl/interval_map.hpp>
#include <boost/icl/interval_set.hpp> #include <boost/icl/interval_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
namespace Dynarmic::Backend { namespace Dynarmic::Backend {
template<typename P> template<typename P>
void BlockRangeInformation<P>::AddRange(boost::icl::discrete_interval<P> range, IR::LocationDescriptor location) { void BlockRangeInformation<P>::AddRange(boost::icl::discrete_interval<P> range, IR::LocationDescriptor location) {
block_ranges.add(std::make_pair(range, ankerl::unordered_dense::set<IR::LocationDescriptor>{location})); block_ranges.add(std::make_pair(range, boost::unordered::unordered_flat_set<IR::LocationDescriptor>{location}));
} }
template<typename P> template<typename P>
@@ -26,8 +27,8 @@ void BlockRangeInformation<P>::ClearCache() {
} }
template<typename P> template<typename P>
ankerl::unordered_dense::set<IR::LocationDescriptor> BlockRangeInformation<P>::InvalidateRanges(const boost::icl::interval_set<P>& ranges) { boost::unordered::unordered_flat_set<IR::LocationDescriptor> BlockRangeInformation<P>::InvalidateRanges(const boost::icl::interval_set<P>& ranges) {
ankerl::unordered_dense::set<IR::LocationDescriptor> erase_locations; boost::unordered::unordered_flat_set<IR::LocationDescriptor> erase_locations;
for (auto invalidate_interval : ranges) { for (auto invalidate_interval : ranges) {
auto pair = block_ranges.equal_range(invalidate_interval); auto pair = block_ranges.equal_range(invalidate_interval);
for (auto it = pair.first; it != pair.second; ++it) for (auto it = pair.first; it != pair.second; ++it)
@@ -12,7 +12,8 @@
#include <boost/icl/interval_map.hpp> #include <boost/icl/interval_map.hpp>
#include <boost/icl/interval_set.hpp> #include <boost/icl/interval_set.hpp>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/ir/location_descriptor.h" #include "dynarmic/ir/location_descriptor.h"
@@ -23,8 +24,8 @@ class BlockRangeInformation {
public: public:
void AddRange(boost::icl::discrete_interval<P> range, IR::LocationDescriptor location); void AddRange(boost::icl::discrete_interval<P> range, IR::LocationDescriptor location);
void ClearCache(); void ClearCache();
ankerl::unordered_dense::set<IR::LocationDescriptor> InvalidateRanges(const boost::icl::interval_set<P>& ranges); boost::unordered::unordered_flat_set<IR::LocationDescriptor> InvalidateRanges(const boost::icl::interval_set<P>& ranges);
boost::icl::interval_map<P, ankerl::unordered_dense::set<IR::LocationDescriptor>> block_ranges; boost::icl::interval_map<P, boost::unordered::unordered_flat_set<IR::LocationDescriptor>> block_ranges;
}; };
} // namespace Dynarmic::Backend } // namespace Dynarmic::Backend
@@ -17,7 +17,8 @@
#include <optional> #include <optional>
#include <shared_mutex> #include <shared_mutex>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <fmt/format.h> #include <fmt/format.h>
#include <sys/mman.h> #include <sys/mman.h>
@@ -55,7 +56,7 @@ class SigHandler {
}); });
} }
ankerl::unordered_dense::map<u64, CodeBlockInfo> code_block_infos; boost::unordered::unordered_flat_map<u64, CodeBlockInfo> code_block_infos;
std::shared_mutex code_block_infos_mutex; std::shared_mutex code_block_infos_mutex;
struct sigaction old_sa_segv; struct sigaction old_sa_segv;
struct sigaction old_sa_bus; struct sigaction old_sa_bus;
@@ -3,9 +3,8 @@
#pragma once #pragma once
#include <boost/unordered/unordered_flat_map.hpp>
#include "dynarmic/backend/loongarch64/lagoon_cpp.h" #include "dynarmic/backend/loongarch64/lagoon_cpp.h"
#include <ankerl/unordered_dense.h>
#include "dynarmic/backend/loongarch64/code_block.h" #include "dynarmic/backend/loongarch64/code_block.h"
#include "dynarmic/backend/loongarch64/emit_loongarch64.h" #include "dynarmic/backend/loongarch64/emit_loongarch64.h"
#include "dynarmic/interface/A32/config.h" #include "dynarmic/interface/A32/config.h"
@@ -53,8 +52,8 @@ private:
const A32::UserConfig conf; const A32::UserConfig conf;
CodeBlock cb; CodeBlock cb;
ankerl::unordered_dense::map<u64, CodePtr> block_entries; boost::container::unordered_map<u64, CodePtr> block_entries;
ankerl::unordered_dense::map<u64, EmittedBlockInfo> block_infos; boost::container::unordered_map<u64, EmittedBlockInfo> block_infos;
public: public:
struct PreludeInfo { struct PreludeInfo {
@@ -9,7 +9,8 @@
#include <vector> #include <vector>
#include "dynarmic/backend/loongarch64/lagoon_cpp.h" #include "dynarmic/backend/loongarch64/lagoon_cpp.h"
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
@@ -9,7 +9,8 @@
#pragma once #pragma once
#include <biscuit/assembler.hpp> #include <biscuit/assembler.hpp>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/riscv64/code_block.h" #include "dynarmic/backend/riscv64/code_block.h"
#include "dynarmic/backend/riscv64/emit_riscv64.h" #include "dynarmic/backend/riscv64/emit_riscv64.h"
@@ -74,8 +75,8 @@ private:
CodeBlock cb; CodeBlock cb;
biscuit::Assembler as; biscuit::Assembler as;
ankerl::unordered_dense::map<u64, CodePtr> block_entries; boost::unordered::unordered_flat_map<u64, CodePtr> block_entries;
ankerl::unordered_dense::map<u64, EmittedBlockInfo> block_infos; boost::unordered::unordered_flat_map<u64, EmittedBlockInfo> block_infos;
struct PreludeInfo { struct PreludeInfo {
CodePtr end_of_prelude; CodePtr end_of_prelude;
@@ -19,7 +19,8 @@
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "dynarmic/mcl/is_instance_of_template.hpp" #include "dynarmic/mcl/is_instance_of_template.hpp"
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/riscv64/stack_layout.h" #include "dynarmic/backend/riscv64/stack_layout.h"
#include "dynarmic/ir/cond.h" #include "dynarmic/ir/cond.h"
@@ -13,7 +13,8 @@
#include <set> #include <set>
#include <tuple> #include <tuple>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/block_range_information.h" #include "dynarmic/backend/block_range_information.h"
#include "dynarmic/backend/x64/a32_jitstate.h" #include "dynarmic/backend/x64/a32_jitstate.h"
@@ -126,11 +127,11 @@ public:
RegAlloc reg_alloc; //reusable reg alloc RegAlloc reg_alloc; //reusable reg alloc
BlockRangeInformation<u32> block_ranges; BlockRangeInformation<u32> block_ranges;
std::array<FastDispatchEntry, fast_dispatch_table_size> fast_dispatch_table; std::array<FastDispatchEntry, fast_dispatch_table_size> fast_dispatch_table;
ankerl::unordered_dense::map<u64, FastmemPatchInfo> fastmem_patch_info; boost::unordered::unordered_flat_map<u64, FastmemPatchInfo> fastmem_patch_info;
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> read_fallbacks; boost::unordered::unordered_flat_map<std::tuple<bool, size_t, int, int>, void (*)()> read_fallbacks;
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks; boost::unordered::unordered_flat_map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks;
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks; boost::unordered::unordered_flat_map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks;
ankerl::unordered_dense::set<DoNotFastmemMarker> do_not_fastmem; boost::unordered::unordered_flat_set<DoNotFastmemMarker> do_not_fastmem;
boost::container::stable_vector<Xbyak::Label> shared_labels; boost::container::stable_vector<Xbyak::Label> shared_labels;
void (*memory_read_128)() = nullptr; // Dummy void (*memory_read_128)() = nullptr; // Dummy
void (*memory_write_128)() = nullptr; // Dummy void (*memory_write_128)() = nullptr; // Dummy
@@ -12,7 +12,8 @@
#include <map> #include <map>
#include <optional> #include <optional>
#include <tuple> #include <tuple>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <boost/container/static_vector.hpp> #include <boost/container/static_vector.hpp>
#include "dynarmic/backend/block_range_information.h" #include "dynarmic/backend/block_range_information.h"
@@ -122,11 +123,11 @@ public:
RegAlloc reg_alloc; //reusable reg alloc RegAlloc reg_alloc; //reusable reg alloc
BlockRangeInformation<u64> block_ranges; BlockRangeInformation<u64> block_ranges;
std::array<FastDispatchEntry, fast_dispatch_table_size> fast_dispatch_table; std::array<FastDispatchEntry, fast_dispatch_table_size> fast_dispatch_table;
ankerl::unordered_dense::map<u64, FastmemPatchInfo> fastmem_patch_info; boost::unordered::unordered_flat_map<u64, FastmemPatchInfo> fastmem_patch_info;
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> read_fallbacks; boost::unordered::unordered_flat_map<std::tuple<bool, size_t, int, int>, void (*)()> read_fallbacks;
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks; boost::unordered::unordered_flat_map<std::tuple<bool, size_t, int, int>, void (*)()> write_fallbacks;
ankerl::unordered_dense::map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks; boost::unordered::unordered_flat_map<std::tuple<bool, size_t, int, int>, void (*)()> exclusive_write_fallbacks;
ankerl::unordered_dense::set<DoNotFastmemMarker> do_not_fastmem; boost::unordered::unordered_flat_set<DoNotFastmemMarker> do_not_fastmem;
boost::container::stable_vector<Xbyak::Label> shared_labels; boost::container::stable_vector<Xbyak::Label> shared_labels;
const void* terminal_handler_pop_rsb_hint = nullptr; const void* terminal_handler_pop_rsb_hint = nullptr;
const void* terminal_handler_fast_dispatch_hint = nullptr; const void* terminal_handler_fast_dispatch_hint = nullptr;
@@ -14,7 +14,8 @@
#include <utility> #include <utility>
#include "common/common_types.h" #include "common/common_types.h"
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/x64/xbyak.h" #include "dynarmic/backend/x64/xbyak.h"
namespace Dynarmic::Backend::X64 { namespace Dynarmic::Backend::X64 {
@@ -43,7 +44,7 @@ private:
} }
}; };
ankerl::unordered_dense::map<ConstantT, void*, ConstantHash> constant_info; boost::unordered::unordered_flat_map<ConstantT, void*, ConstantHash> constant_info;
std::span<ConstantT> pool; std::span<ConstantT> pool;
std::size_t insertion_point; std::size_t insertion_point;
}; };
@@ -14,7 +14,8 @@
#include <boost/variant/detail/apply_visitor_binary.hpp> #include <boost/variant/detail/apply_visitor_binary.hpp>
#include "dynarmic/mcl/bit.hpp" #include "dynarmic/mcl/bit.hpp"
#include "common/common_types.h" #include "common/common_types.h"
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "dynarmic/backend/x64/block_of_code.h" #include "dynarmic/backend/x64/block_of_code.h"
#include "dynarmic/backend/x64/nzcv_util.h" #include "dynarmic/backend/x64/nzcv_util.h"
@@ -396,7 +397,7 @@ void EmitX64::ClearCache() {
PerfMapClear(); PerfMapClear();
} }
void EmitX64::InvalidateBasicBlocks(const ankerl::unordered_dense::set<IR::LocationDescriptor>& locations) { void EmitX64::InvalidateBasicBlocks(const boost::unordered::unordered_flat_set<IR::LocationDescriptor>& locations) {
code.EnableWriting(); code.EnableWriting();
for (const auto& descriptor : locations) { for (const auto& descriptor : locations) {
if (auto const it = block_descriptors.find(descriptor); it != block_descriptors.end()) { if (auto const it = block_descriptors.find(descriptor); it != block_descriptors.end()) {
@@ -16,7 +16,8 @@
#include <type_traits> #include <type_traits>
#include <vector> #include <vector>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <boost/container/stable_vector.hpp> #include <boost/container/stable_vector.hpp>
#include <boost/container/small_vector.hpp> #include <boost/container/small_vector.hpp>
@@ -88,7 +89,7 @@ public:
virtual void ClearCache(); virtual void ClearCache();
/// Invalidates a selection of basic blocks. /// Invalidates a selection of basic blocks.
void InvalidateBasicBlocks(const ankerl::unordered_dense::set<IR::LocationDescriptor>& locations); void InvalidateBasicBlocks(const boost::unordered::unordered_flat_set<IR::LocationDescriptor>& locations);
//protected: //protected:
// Microinstruction emitters // Microinstruction emitters
@@ -131,8 +132,8 @@ public:
// State // State
BlockOfCode& code; BlockOfCode& code;
ExceptionHandler exception_handler; ExceptionHandler exception_handler;
ankerl::unordered_dense::map<IR::LocationDescriptor, BlockDescriptor> block_descriptors; boost::unordered::unordered_flat_map<IR::LocationDescriptor, BlockDescriptor> block_descriptors;
ankerl::unordered_dense::map<IR::LocationDescriptor, PatchInformation> patch_information; boost::unordered::unordered_flat_map<IR::LocationDescriptor, PatchInformation> patch_information;
// We need materialized protected members // We need materialized protected members
friend class A64EmitX64; friend class A64EmitX64;
@@ -4,10 +4,11 @@
#pragma once #pragma once
// You must ensure this matches with src/common/x64/xbyak.h on root dir // You must ensure this matches with src/common/x64/xbyak.h on root dir
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#define XBYAK_STD_UNORDERED_SET ankerl::unordered_dense::set #define XBYAK_STD_UNORDERED_SET boost::unordered::unordered_flat_set
#define XBYAK_STD_UNORDERED_MAP ankerl::unordered_dense::map #define XBYAK_STD_UNORDERED_MAP boost::unordered::unordered_flat_map
#define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap #define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap
#include <xbyak/xbyak.h> #include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h> #include <xbyak/xbyak_util.h>
+3 -2
View File
@@ -11,7 +11,8 @@
#include <map> #include <map>
#include <bit> #include <bit>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "boost/container/small_vector.hpp" #include "boost/container/small_vector.hpp"
#include "dynarmic/frontend/A32/a32_ir_emitter.h" #include "dynarmic/frontend/A32/a32_ir_emitter.h"
#include "dynarmic/frontend/A32/a32_location_descriptor.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)); ASSERT(IR::AreTypesCompatible(t1, t2));
} }
} }
ankerl::unordered_dense::map<IR::Inst*, size_t> actual_uses; boost::unordered::unordered_flat_map<IR::Inst*, size_t> actual_uses;
for (auto const& inst : block.instructions) { for (auto const& inst : block.instructions) {
for (size_t i = 0; i < inst.NumArgs(); i++) for (size_t i = 0; i < inst.NumArgs(); i++)
if (IR::Value const arg = inst.GetArg(i); !arg.IsImmediate()) if (IR::Value const arg = inst.GetArg(i); !arg.IsImmediate())
+3 -2
View File
@@ -8,7 +8,8 @@
#include <array> #include <array>
#include <exception> #include <exception>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include "common/common_types.h" #include "common/common_types.h"
@@ -23,7 +24,7 @@ namespace {
class MyEnvironment final : public A64::UserCallbacks { class MyEnvironment final : public A64::UserCallbacks {
public: public:
u64 ticks_left = 0; u64 ticks_left = 0;
ankerl::unordered_dense::map<u64, u8> memory{}; boost::unordered::unordered_flat_map<u64, u8> memory{};
u8 MemoryRead8(u64 vaddr) override { u8 MemoryRead8(u64 vaddr) override {
return memory[vaddr]; return memory[vaddr];
+3 -2
View File
@@ -8,7 +8,8 @@
#pragma once #pragma once
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "dynarmic/interface/A64/a64.h" #include "dynarmic/interface/A64/a64.h"
@@ -17,7 +18,7 @@ using Vector = Dynarmic::A64::Vector;
class A64TestEnv : public Dynarmic::A64::UserCallbacks { class A64TestEnv : public Dynarmic::A64::UserCallbacks {
public: public:
ankerl::unordered_dense::map<u64, u8> modified_memory; boost::unordered::unordered_flat_map<u64, u8> modified_memory;
std::vector<u32> code_mem; std::vector<u32> code_mem;
u64 ticks_left = 0; u64 ticks_left = 0;
u64 code_mem_start_address = 0; u64 code_mem_start_address = 0;
+5 -5
View File
@@ -24,7 +24,7 @@ add_executable(dynarmic_tests
A64/real_world.cpp A64/real_world.cpp
A64/testenv.h 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) if (DYNARMIC_TESTS_USE_UNICORN)
target_link_libraries(dynarmic_tests PRIVATE Unicorn::Unicorn) target_link_libraries(dynarmic_tests PRIVATE Unicorn::Unicorn)
@@ -72,7 +72,7 @@ add_executable(dynarmic_print_info
print_info.cpp print_info.cpp
) )
create_target_directory_groups(dynarmic_print_info) 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) if (BOOST_NO_HEADERS)
target_link_libraries(dynarmic_print_info PRIVATE Boost::variant Boost::icl Boost::pool) target_link_libraries(dynarmic_print_info PRIVATE Boost::variant Boost::icl Boost::pool)
else() else()
@@ -93,7 +93,7 @@ add_executable(dynarmic_test_generator
create_target_directory_groups(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) if (BOOST_NO_HEADERS)
target_link_libraries(dynarmic_test_generator PRIVATE Boost::variant Boost::icl Boost::pool) target_link_libraries(dynarmic_test_generator PRIVATE Boost::variant Boost::icl Boost::pool)
else() else()
@@ -110,7 +110,7 @@ add_executable(dynarmic_test_reader
test_reader.cpp test_reader.cpp
) )
create_target_directory_groups(dynarmic_test_reader) 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) if (BOOST_NO_HEADERS)
target_link_libraries(dynarmic_test_reader PRIVATE Boost::variant Boost::icl Boost::pool) target_link_libraries(dynarmic_test_reader PRIVATE Boost::variant Boost::icl Boost::pool)
else() else()
@@ -123,7 +123,7 @@ target_compile_definitions(dynarmic_test_reader PRIVATE FMT_USE_USER_DEFINED_LIT
# #
create_target_directory_groups(dynarmic_tests) 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) if (BOOST_NO_HEADERS)
target_link_libraries(dynarmic_tests PRIVATE Boost::variant Boost::icl Boost::pool) target_link_libraries(dynarmic_tests PRIVATE Boost::variant Boost::icl Boost::pool)
else() else()
+3 -2
View File
@@ -11,7 +11,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
@@ -185,7 +186,7 @@ private:
mutable std::mutex mutex; mutable std::mutex mutex;
mutable std::mutex callback_mutex; mutable std::mutex callback_mutex;
ankerl::unordered_dense::map<int, ConsoleUpdateCallback> callback_list; boost::unordered::unordered_flat_map<int, ConsoleUpdateCallback> callback_list;
int last_callback_key = 0; int last_callback_key = 0;
// Stores the current status of all console input // Stores the current status of all console input
+3 -2
View File
@@ -14,7 +14,8 @@
#include <vector> #include <vector>
#include <atomic> #include <atomic>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/input.h" #include "common/input.h"
@@ -636,7 +637,7 @@ private:
ControllerMotionDevices virtual_motion_devices; ControllerMotionDevices virtual_motion_devices;
mutable std::mutex callback_mutex; mutable std::mutex callback_mutex;
ankerl::unordered_dense::map<int, ControllerUpdateCallback> callback_list; boost::unordered::unordered_flat_map<int, ControllerUpdateCallback> callback_list;
int last_callback_key = 0; int last_callback_key = 0;
// Stores the current status of all controller input // Stores the current status of all controller input
+3 -2
View File
@@ -10,7 +10,8 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
@@ -205,7 +206,7 @@ private:
mutable std::mutex mutex; mutable std::mutex mutex;
mutable std::mutex callback_mutex; mutable std::mutex callback_mutex;
ankerl::unordered_dense::map<int, InterfaceUpdateCallback> callback_list; boost::unordered::unordered_flat_map<int, InterfaceUpdateCallback> callback_list;
int last_callback_key = 0; int last_callback_key = 0;
// Stores the current status of all external device input // Stores the current status of all external device input
+1 -1
View File
@@ -90,7 +90,7 @@ public:
Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override; Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override;
private: private:
ankerl::unordered_dense::map<PadIdentifier, jobject> input_devices; boost::unordered::unordered_flat_map<PadIdentifier, jobject> input_devices;
/// Returns the correct identifier corresponding to the player index /// Returns the correct identifier corresponding to the player index
PadIdentifier GetIdentifier(const std::string& guid, size_t port) const; PadIdentifier GetIdentifier(const std::string& guid, size_t port) const;
+1 -1
View File
@@ -732,7 +732,7 @@ SDLDriver::~SDLDriver() {
std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const { std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
std::vector<Common::ParamPackage> devices; std::vector<Common::ParamPackage> devices;
ankerl::unordered_dense::map<int, std::shared_ptr<SDLJoystick>> joycon_pairs; boost::unordered::unordered_flat_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
for (const auto& [key, value] : joystick_map) { for (const auto& [key, value] : joystick_map) {
for (const auto& joystick : value) { for (const auto& joystick : value) {
if (!joystick->GetSDLJoystick()) { if (!joystick->GetSDLJoystick()) {
+3 -2
View File
@@ -9,7 +9,8 @@
#include <atomic> #include <atomic>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
@@ -117,7 +118,7 @@ private:
Common::SPSCQueue<VibrationRequest> vibration_queue; Common::SPSCQueue<VibrationRequest> vibration_queue;
/// Map of GUID of a list of corresponding virtual Joysticks /// Map of GUID of a list of corresponding virtual Joysticks
ankerl::unordered_dense::map<Common::UUID, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map; boost::unordered::unordered_flat_map<Common::UUID, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map;
std::mutex joystick_map_mutex; std::mutex joystick_map_mutex;
bool start_thread = false; bool start_thread = false;
+7 -7
View File
@@ -8,7 +8,7 @@
#include <functional> #include <functional>
#include <mutex> #include <mutex>
#include <ankerl/unordered_dense.h> #include <boost/container/flat_map.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/input.h" #include "common/input.h"
@@ -270,10 +270,10 @@ protected:
private: private:
struct ControllerData { struct ControllerData {
ankerl::unordered_dense::map<int, bool> buttons; boost::container::flat_map<int, bool> buttons;
ankerl::unordered_dense::map<int, u8> hat_buttons; boost::container::flat_map<int, u8> hat_buttons;
ankerl::unordered_dense::map<int, float> axes; boost::container::flat_map<int, float> axes;
ankerl::unordered_dense::map<int, BasicMotion> motions; boost::container::flat_map<int, BasicMotion> motions;
Common::Input::BatteryLevel battery{}; Common::Input::BatteryLevel battery{};
Common::Input::BodyColorStatus color{}; Common::Input::BodyColorStatus color{};
Common::Input::CameraStatus camera{}; Common::Input::CameraStatus camera{};
@@ -301,8 +301,8 @@ private:
bool configuring{false}; bool configuring{false};
const std::string input_engine; const std::string input_engine;
int last_callback_key = 0; int last_callback_key = 0;
ankerl::unordered_dense::map<PadIdentifier, ControllerData> controller_list; boost::unordered::unordered_flat_map<PadIdentifier, ControllerData> controller_list;
ankerl::unordered_dense::map<int, InputIdentifier> callback_list; boost::unordered::unordered_flat_map<int, InputIdentifier> callback_list;
MappingCallback mapping_callback; MappingCallback mapping_callback;
}; };
+5 -4
View File
@@ -8,7 +8,8 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
namespace Common { 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 * Given a ParamPackage for a Device returned from `GetInputDevices`, attempt to get the default
* mapping for the device. * mapping for the device.
*/ */
using AnalogMapping = ankerl::unordered_dense::map<Settings::NativeAnalog::Values, Common::ParamPackage>; using AnalogMapping = boost::unordered::unordered_flat_map<Settings::NativeAnalog::Values, Common::ParamPackage>;
using ButtonMapping = ankerl::unordered_dense::map<Settings::NativeButton::Values, Common::ParamPackage>; using ButtonMapping = boost::unordered::unordered_flat_map<Settings::NativeButton::Values, Common::ParamPackage>;
using MotionMapping = ankerl::unordered_dense::map<Settings::NativeMotion::Values, Common::ParamPackage>; using MotionMapping = boost::unordered::unordered_flat_map<Settings::NativeMotion::Values, Common::ParamPackage>;
class InputSubsystem { class InputSubsystem {
public: public:
@@ -9,7 +9,8 @@
#include <array> #include <array>
#include <sirit/sirit.h> #include <sirit/sirit.h>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "shader_recompiler/backend/bindings.h" #include "shader_recompiler/backend/bindings.h"
#include "shader_recompiler/frontend/ir/program.h" #include "shader_recompiler/frontend/ir/program.h"
@@ -370,7 +371,7 @@ public:
Id load_const_func_u32x4{}; Id load_const_func_u32x4{};
// Sirit::Id doesn't play nice with *::set<> // Sirit::Id doesn't play nice with *::set<>
ankerl::unordered_dense::set<u32> non_uniform_ids; boost::unordered::unordered_flat_set<u32> non_uniform_ids;
bool uses_nonuniform_sampled_image{}; bool uses_nonuniform_sampled_image{};
bool uses_nonuniform_storage_image{}; bool uses_nonuniform_storage_image{};
+5 -4
View File
@@ -7,7 +7,8 @@
#pragma once #pragma once
#include <array> #include <array>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "shader_recompiler/program_header.h" #include "shader_recompiler/program_header.h"
@@ -126,9 +127,9 @@ protected:
u32 start_address{}; u32 start_address{};
bool is_proprietary_driver{}; bool is_proprietary_driver{};
public: public:
ankerl::unordered_dense::map<CbufWordKey, u32, CbufWordKeyHash> cbuf_word_cache; boost::unordered::unordered_flat_map<CbufWordKey, u32, CbufWordKeyHash> cbuf_word_cache;
ankerl::unordered_dense::map<HandleKey, u32, HandleKeyHash> handle_cache; boost::unordered::unordered_flat_map<HandleKey, u32, HandleKeyHash> handle_cache;
ankerl::unordered_dense::map<const IR::Inst*, ConstBufferAddr> track_cache; boost::unordered::unordered_flat_map<const IR::Inst*, ConstBufferAddr> track_cache;
}; };
} // namespace Shader } // namespace Shader
@@ -7,7 +7,8 @@
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <utility> #include <utility>
#include <vector> #include <vector>
@@ -390,7 +391,7 @@ private:
std::optional<Node> return_label) { std::optional<Node> return_label) {
Statement* const false_stmt{pool.Create(Identity{}, IR::Condition{false}, &root_stmt)}; Statement* const false_stmt{pool.Create(Identity{}, IR::Condition{false}, &root_stmt)};
Tree& root{root_stmt.children}; Tree& root{root_stmt.children};
ankerl::unordered_dense::map<Flow::Block*, Node> local_labels; boost::unordered::unordered_flat_map<Flow::Block*, Node> local_labels;
local_labels.reserve(function.blocks.size()); local_labels.reserve(function.blocks.size());
for (Flow::Block& block : function.blocks) { for (Flow::Block& block : function.blocks) {
@@ -19,7 +19,8 @@
#include <deque> #include <deque>
#include <map> #include <map>
#include <span> #include <span>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <variant> #include <variant>
#include <vector> #include <vector>
@@ -7,7 +7,8 @@
#include <algorithm> #include <algorithm>
#include <bit> #include <bit>
#include <optional> #include <optional>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <tuple> #include <tuple>
#include <limits> #include <limits>
#include <boost/container/small_vector.hpp> #include <boost/container/small_vector.hpp>
+3 -2
View File
@@ -11,7 +11,8 @@
#include <mutex> #include <mutex>
#include <stdexcept> #include <stdexcept>
#include <thread> #include <thread>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
@@ -39,7 +40,7 @@ public:
private: private:
mutable std::mutex mutex; mutable std::mutex mutex;
ankerl::unordered_dense::map<std::thread::id, u32> ids; boost::unordered::unordered_flat_map<std::thread::id, u32> ids;
}; };
class TestControl1 { class TestControl1 {
+3 -2
View File
@@ -3,7 +3,8 @@
#include <memory> #include <memory>
#include <stdexcept> #include <stdexcept>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <tuple> #include <tuple>
#include <vector> #include <vector>
#include <optional> #include <optional>
@@ -65,7 +66,7 @@ public:
} }
private: private:
ankerl::unordered_dense::map<u64, int> page_table; boost::unordered::unordered_flat_map<u64, int> page_table;
std::vector<std::tuple<DAddr, u64, int>> calls; std::vector<std::tuple<DAddr, u64, int>> calls;
size_t update_calls = 0; size_t update_calls = 0;
}; };
@@ -16,7 +16,8 @@
#include <span> #include <span>
#include <vector> #include <vector>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <boost/container/static_vector.hpp> #include <boost/container/static_vector.hpp>
#include <boost/container/small_vector.hpp> #include <boost/container/small_vector.hpp>
@@ -11,7 +11,8 @@
#include <deque> #include <deque>
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <utility> #include <utility>
#include "common/alignment.h" #include "common/alignment.h"
@@ -257,7 +258,7 @@ private:
std::array<Manager*, NUM_HIGH_PAGES> top_tier{}; std::array<Manager*, NUM_HIGH_PAGES> top_tier{};
std::deque<std::array<Manager, MANAGER_POOL_SIZE>> manager_pool; std::deque<std::array<Manager, MANAGER_POOL_SIZE>> manager_pool;
std::deque<Manager*> free_managers; std::deque<Manager*> free_managers;
ankerl::unordered_dense::set<u32> cached_pages; boost::unordered::unordered_flat_set<u32> cached_pages;
DeviceTracker* device_tracker = nullptr; DeviceTracker* device_tracker = nullptr;
}; };
+4 -3
View File
@@ -10,7 +10,8 @@
#include <limits> #include <limits>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
@@ -88,14 +89,14 @@ protected:
std::deque<P> channel_storage; std::deque<P> channel_storage;
std::deque<size_t> free_channel_ids; std::deque<size_t> free_channel_ids;
ankerl::unordered_dense::map<s32, size_t> channel_map; boost::unordered::unordered_flat_map<s32, size_t> channel_map;
std::vector<size_t> active_channel_ids; std::vector<size_t> active_channel_ids;
struct AddressSpaceRef { struct AddressSpaceRef {
size_t ref_count; size_t ref_count;
size_t storage_id; size_t storage_id;
Tegra::MemoryManager* gpu_memory; Tegra::MemoryManager* gpu_memory;
}; };
ankerl::unordered_dense::map<size_t, AddressSpaceRef> address_spaces; boost::unordered::unordered_flat_map<size_t, AddressSpaceRef> address_spaces;
mutable std::mutex config_mutex; mutable std::mutex config_mutex;
virtual void OnGPUASRegister([[maybe_unused]] size_t map_id) {} virtual void OnGPUASRegister([[maybe_unused]] size_t map_id) {}
+3 -2
View File
@@ -8,7 +8,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "video_core/dma_pusher.h" #include "video_core/dma_pusher.h"
@@ -27,7 +28,7 @@ public:
void DeclareChannel(std::shared_ptr<ChannelState> new_channel); void DeclareChannel(std::shared_ptr<ChannelState> new_channel);
private: private:
ankerl::unordered_dense::map<s32, std::shared_ptr<ChannelState>> channels; boost::unordered::unordered_flat_map<s32, std::shared_ptr<ChannelState>> channels;
std::mutex scheduling_guard; std::mutex scheduling_guard;
}; };
+1 -1
View File
@@ -3111,7 +3111,7 @@ public:
void SetHLEReplacementAttributeType(u32 bank, u32 offset, HLEReplacementAttributeType name); void SetHLEReplacementAttributeType(u32 bank, u32 offset, HLEReplacementAttributeType name);
ankerl::unordered_dense::map<u64, HLEReplacementAttributeType> replace_table; boost::unordered::unordered_flat_map<u64, HLEReplacementAttributeType> replace_table;
static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Maxwell3D Regs has wrong size"); static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Maxwell3D Regs has wrong size");
static_assert(std::is_trivially_copyable_v<Regs>, "Maxwell3D Regs must be trivially copyable"); static_assert(std::is_trivially_copyable_v<Regs>, "Maxwell3D Regs must be trivially copyable");
@@ -7,7 +7,8 @@
#include <array> #include <array>
#include <cmath> #include <cmath>
#include <span> #include <span>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <bit> #include <bit>
#include <numeric> #include <numeric>
#include "common/assert.h" #include "common/assert.h"
@@ -924,7 +925,7 @@ public:
}; };
struct ConverterFactory::ConverterFactoryImpl { struct ConverterFactory::ConverterFactoryImpl {
ankerl::unordered_dense::map<RenderTargetFormat, std::unique_ptr<Converter>> converters_cache; boost::unordered::unordered_flat_map<RenderTargetFormat, std::unique_ptr<Converter>> converters_cache;
}; };
ConverterFactory::ConverterFactory() { ConverterFactory::ConverterFactory() {
+1 -1
View File
@@ -333,7 +333,7 @@ struct GPU::Impl {
std::unique_ptr<Core::Frontend::GraphicsContext> cpu_context; std::unique_ptr<Core::Frontend::GraphicsContext> cpu_context;
Tegra::Control::Scheduler scheduler; Tegra::Control::Scheduler scheduler;
ankerl::unordered_dense::map<s32, std::shared_ptr<Tegra::Control::ChannelState>> channels; boost::unordered::unordered_flat_map<s32, std::shared_ptr<Tegra::Control::ChannelState>> channels;
Tegra::Control::ChannelState* current_channel; Tegra::Control::ChannelState* current_channel;
s32 bound_channel{-1}; s32 bound_channel{-1};
+3 -2
View File
@@ -10,7 +10,8 @@
#include <set> #include <set>
#include <span> #include <span>
#include <string> #include <string>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
@@ -152,7 +153,7 @@ private:
mutable std::mutex ring_buffer_mutex; mutable std::mutex ring_buffer_mutex;
// Memory tracking // Memory tracking
ankerl::unordered_dense::map<uintptr_t, MemoryAllocationEntry> memory_allocations; boost::unordered::unordered_flat_map<uintptr_t, MemoryAllocationEntry> memory_allocations;
mutable std::mutex memory_mutex; mutable std::mutex memory_mutex;
// Statistics // Statistics
+2 -1
View File
@@ -11,7 +11,8 @@
#include <optional> #include <optional>
#include <string_view> #include <string_view>
#include <tuple> #include <tuple>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <queue> #include <queue>
#include "common/common_types.h" #include "common/common_types.h"
+3 -2
View File
@@ -6,7 +6,8 @@
#pragma once #pragma once
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <unordered_map> #include <unordered_map>
#include <variant> #include <variant>
@@ -118,7 +119,7 @@ private:
} }
std::mutex m_mutex{}; std::mutex m_mutex{};
ankerl::unordered_dense::map<s32, FrameDevice> m_frame_devices; boost::unordered::unordered_flat_map<s32, FrameDevice> m_frame_devices;
static constexpr size_t MAX_PRESENT_QUEUE = 100; static constexpr size_t MAX_PRESENT_QUEUE = 100;
static constexpr size_t MAX_DECODE_MAP = 200; static constexpr size_t MAX_DECODE_MAP = 200;
+4 -3
View File
@@ -10,7 +10,8 @@
#include <span> #include <span>
#include <variant> #include <variant>
#include <vector> #include <vector>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/bit_field.h" #include "common/bit_field.h"
#include "common/common_types.h" #include "common/common_types.h"
@@ -237,8 +238,8 @@ struct MacroEngine {
AnyCachedMacro program; AnyCachedMacro program;
u64 hash{}; u64 hash{};
}; };
ankerl::unordered_dense::map<u32, CacheInfo> macro_cache; boost::unordered::unordered_flat_map<u32, CacheInfo> macro_cache;
ankerl::unordered_dense::map<u32, std::vector<u32>> uploaded_macro_code; boost::unordered::unordered_flat_map<u32, std::vector<u32>> uploaded_macro_code;
bool is_interpreted; bool is_interpreted;
}; };
+3 -2
View File
@@ -15,7 +15,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector> #include <vector>
#include "common/assert.h" #include "common/assert.h"
@@ -350,7 +351,7 @@ private:
mutable std::recursive_mutex mutex; mutable std::recursive_mutex mutex;
ankerl::unordered_dense::map<u64, std::vector<CachedQuery>> cached_queries; boost::unordered::unordered_flat_map<u64, std::vector<CachedQuery>> cached_queries;
std::array<CounterStream, VideoCore::NumQueryTypes> streams; std::array<CounterStream, VideoCore::NumQueryTypes> streams;
+2 -1
View File
@@ -10,7 +10,8 @@
#include <deque> #include <deque>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <utility> #include <utility>
#include "common/assert.h" #include "common/assert.h"
@@ -10,7 +10,8 @@
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <span> #include <span>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <utility> #include <utility>
#include "common/assert.h" #include "common/assert.h"
@@ -160,7 +161,7 @@ protected:
} }
} }
using ContentCache = ankerl::unordered_dense::map<u64, ankerl::unordered_dense::map<u32, QueryLocation>>; using ContentCache = boost::unordered::unordered_flat_map<u64, boost::unordered::unordered_flat_map<u32, QueryLocation>>;
void InvalidateQuery(QueryLocation location); void InvalidateQuery(QueryLocation location);
bool IsQueryDirty(QueryLocation location); bool IsQueryDirty(QueryLocation location);
@@ -168,7 +169,7 @@ protected:
void RequestGuestHostSync(); void RequestGuestHostSync();
void UnregisterPending(); void UnregisterPending();
ankerl::unordered_dense::map<u64, ankerl::unordered_dense::map<u32, QueryLocation>> cached_queries; boost::unordered::unordered_flat_map<u64, boost::unordered::unordered_flat_map<u32, QueryLocation>> cached_queries;
std::mutex cache_mutex; std::mutex cache_mutex;
struct QueryCacheBaseImpl; struct QueryCacheBaseImpl;
@@ -8,7 +8,8 @@
#include <array> #include <array>
#include <span> #include <span>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "video_core/buffer_cache/buffer_cache_base.h" #include "video_core/buffer_cache/buffer_cache_base.h"
@@ -242,7 +243,7 @@ private:
u32 index_buffer_offset = 0; u32 index_buffer_offset = 0;
u64 device_access_memory; u64 device_access_memory;
ankerl::unordered_dense::map<GPUVAddr, OGLTransformFeedback> tfb_objects; boost::unordered::unordered_flat_map<GPUVAddr, OGLTransformFeedback> tfb_objects;
}; };
struct BufferCacheParams { struct BufferCacheParams {
@@ -7,7 +7,8 @@
#pragma once #pragma once
#include <filesystem> #include <filesystem>
#include <ankerl/unordered_dense.h> #include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/thread_worker.h" #include "common/thread_worker.h"
@@ -81,8 +82,8 @@ private:
GraphicsPipeline* current_pipeline{}; GraphicsPipeline* current_pipeline{};
ShaderContext::ShaderPools main_pools; ShaderContext::ShaderPools main_pools;
ankerl::unordered_dense::map<GraphicsPipelineKey, std::unique_ptr<GraphicsPipeline>> graphics_cache; boost::unordered::unordered_flat_map<GraphicsPipelineKey, std::unique_ptr<GraphicsPipeline>> graphics_cache;
ankerl::unordered_dense::map<ComputePipelineKey, std::unique_ptr<ComputePipeline>> compute_cache; boost::unordered::unordered_flat_map<ComputePipelineKey, std::unique_ptr<ComputePipeline>> compute_cache;
Shader::Profile profile; Shader::Profile profile;
Shader::HostTranslateInfo host_info; Shader::HostTranslateInfo host_info;
@@ -159,7 +159,7 @@ private:
UtilShaders util_shaders; UtilShaders util_shaders;
FormatConversionPass format_conversion_pass; FormatConversionPass format_conversion_pass;
std::array<ankerl::unordered_dense::map<GLenum, FormatProperties>, 3> format_properties; std::array<boost::unordered::unordered_flat_map<GLenum, FormatProperties>, 3> format_properties;
bool has_broken_texture_view_formats = false; bool has_broken_texture_view_formats = false;
OGLTexture null_image_1d_array; OGLTexture null_image_1d_array;

Some files were not shown because too many files have changed in this diff Show More