summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCache.h
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-04-06 21:00:43 -0400
committerMason Reed <mason@vector35.com>2025-04-06 21:11:00 -0400
commit833375c0199d4e7c2555e6e9f14862ddc3ca120c (patch)
tree5cebee81848306b30d5b205d0116f1bcdad7737c /view/sharedcache/core/SharedCache.h
parentc22d54c5d95f4d23629484579414387b0c7503ee (diff)
[SharedCache] Prevent some unneeded copies when processing
Also swapped out CacheEntry::m_images to a vector as its never actually used as a lookup
Diffstat (limited to 'view/sharedcache/core/SharedCache.h')
-rw-r--r--view/sharedcache/core/SharedCache.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/view/sharedcache/core/SharedCache.h b/view/sharedcache/core/SharedCache.h
index 3f2caed5..ff329ecf 100644
--- a/view/sharedcache/core/SharedCache.h
+++ b/view/sharedcache/core/SharedCache.h
@@ -136,11 +136,11 @@ class CacheEntry
std::vector<dyld_cache_mapping_info> m_mappings {};
// Mapping of image path to image info, used within ProcessImagesAndRegions to add them to the cache.
// Also used to retrieve the image dependencies.
- std::unordered_map<std::string, dyld_cache_image_info> m_images {};
+ std::vector<std::pair<std::string, dyld_cache_image_info>> m_images {};
public:
CacheEntry(std::string filePath, std::string fileName, CacheEntryType type, dyld_cache_header header,
- std::vector<dyld_cache_mapping_info> mappings, std::unordered_map<std::string, dyld_cache_image_info> images);
+ std::vector<dyld_cache_mapping_info> mappings, std::vector<std::pair<std::string, dyld_cache_image_info>> images);
CacheEntry() = default;
@@ -173,7 +173,7 @@ public:
const std::string GetFileName() const { return m_fileName; }
const dyld_cache_header& GetHeader() const { return m_header; }
const std::vector<dyld_cache_mapping_info>& GetMappings() const { return m_mappings; }
- const std::unordered_map<std::string, dyld_cache_image_info>& GetImages() const { return m_images; }
+ const std::vector<std::pair<std::string, dyld_cache_image_info>>& GetImages() const { return m_images; }
};
// The ID for a given CacheEntry, use this instead of passing a pointer around to avoid complexity :V
@@ -227,10 +227,10 @@ public:
const std::unordered_map<uint64_t, CacheSymbol>& GetSymbols() const { return m_symbols; }
const std::unordered_map<std::string, uint64_t>& GetNamedSymbols() const { return m_namedSymbols; }
- void AddImage(CacheImage image);
+ void AddImage(CacheImage&& image);
// Add a region that may overlap with another.
- void AddRegion(CacheRegion region);
+ void AddRegion(CacheRegion&& region);
void AddSymbol(CacheSymbol symbol);