diff options
| author | Mason Reed <mason@vector35.com> | 2025-04-01 01:03:56 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-04-02 05:36:54 -0400 |
| commit | e1b164fa2bd10d5662c65ed930416d2f911c12e1 (patch) | |
| tree | 52edee3d42e0f414b4553145b523b3345f2665a4 /view/sharedcache/core/SharedCacheController.h | |
| parent | 7d8fab3ca667ea727becce31ce605d932c8784ed (diff) | |
[SharedCache] Fix some bugs
Diffstat (limited to 'view/sharedcache/core/SharedCacheController.h')
| -rw-r--r-- | view/sharedcache/core/SharedCacheController.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/view/sharedcache/core/SharedCacheController.h b/view/sharedcache/core/SharedCacheController.h index 354762eb..3b92f198 100644 --- a/view/sharedcache/core/SharedCacheController.h +++ b/view/sharedcache/core/SharedCacheController.h @@ -18,8 +18,11 @@ namespace BinaryNinja::DSC { { IMPLEMENT_DSC_API_OBJECT(BNSharedCacheController); Ref<Logger> m_logger; - SharedCache m_cache; + + // Locks on load attempts (region or image). + std::shared_mutex m_loadMutex; + // Store the open images. // Things other than the cache here will be serialized. std::unordered_set<uint64_t> m_loadedRegions; @@ -49,13 +52,13 @@ namespace BinaryNinja::DSC { bool ApplyRegion(BinaryView& view, const CacheRegion& region); - bool IsRegionLoaded(const CacheRegion& region) const; + bool IsRegionLoaded(const CacheRegion& region); // Loads the relevant image info into the view. This does not update analysis so if you // call this make sure at some point you update analysis and likely with linear sweep. bool ApplyImage(BinaryView& view, const CacheImage& image); - bool IsImageLoaded(const CacheImage& image) const; + bool IsImageLoaded(const CacheImage& image); // Get the metadata for saving the state of the shared cache. Ref<Metadata> GetMetadata() const; |
