diff options
| author | WeiN76LQh <WeiN76LQh@github.com> | 2024-11-25 16:04:33 +0000 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2024-12-25 09:41:05 -0500 |
| commit | 08d91f14061c54134038fadc2d333a3aa3da0fe1 (patch) | |
| tree | 3c608285b2323ade03aebbe5f1ef7f56ada9e7c5 /view/sharedcache/core/SharedCache.cpp | |
| parent | ce76c08060a8f4ac87334e5543ef7359b8e8760b (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.cpp | 1 |
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--; } |
