summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCache.cpp
diff options
context:
space:
mode:
authorWeiN76LQh <WeiN76LQh@github.com>2024-11-25 16:04:33 +0000
committerkat <kat@vector35.com>2024-12-25 09:41:05 -0500
commit08d91f14061c54134038fadc2d333a3aa3da0fe1 (patch)
tree3c608285b2323ade03aebbe5f1ef7f56ada9e7c5 /view/sharedcache/core/SharedCache.cpp
parentce76c08060a8f4ac87334e5543ef7359b8e8760b (diff)
[SharedCache] Remove unnecessary lock in `SharedCache` destructor
From what I can tell the lock being taken in `SharedCache::~SharedCache` was purely for the decrement of `sharedCacheReferences`, however its an atomic so a lock isn't necessary. The lock being taken is extremely contentious and therefore often slow to be acquired. This resulted in a surprising amount of execution time spent in the `SharedCache` destructor. Nothing hugely significant but a quick and easy win to remove this single line of code.
Diffstat (limited to 'view/sharedcache/core/SharedCache.cpp')
-rw-r--r--view/sharedcache/core/SharedCache.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp
index e4d4ef11..7bbacf63 100644
--- a/view/sharedcache/core/SharedCache.cpp
+++ b/view/sharedcache/core/SharedCache.cpp
@@ -1424,7 +1424,6 @@ SharedCache::SharedCache(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView) : m_
}
SharedCache::~SharedCache() {
- std::unique_lock<std::mutex> lock(viewSpecificMutexes[m_dscView->GetFile()->GetSessionId()].viewOperationsThatInfluenceMetadataMutex);
sharedCacheReferences--;
}