summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCacheController.h
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-04-04 23:45:06 -0400
committerMason Reed <mason@vector35.com>2025-04-06 20:00:37 -0400
commit2e855275732aed00486ca100f4151f4074d9949e (patch)
tree24916cf3ffe405706c18d34808d26ef2de893139 /view/sharedcache/core/SharedCacheController.h
parent41450c3df2be33b817c864fb71ca38d76d81d2ab (diff)
[SharedCache] Add a named symbol map
Fixes https://github.com/Vector35/binaryninja-api/issues/6561 - Also tightens the SharedCache class to move only, to prevent accidental copies. - Also removes some extra copies in FFI when should pass by ref - Also adds `get_symbol_with_name` to python API The current named symbol map is populated in a worker thread spawned in the view init. This is because populating the map can take about 1 second. If we are fine with another 1 second added to the view init time then we can add it serially but I don't think this way is _that_ bad, no analysis consults this, however a user might add a workflow that would be racing this. So we need to add a mutex.
Diffstat (limited to 'view/sharedcache/core/SharedCacheController.h')
-rw-r--r--view/sharedcache/core/SharedCacheController.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/view/sharedcache/core/SharedCacheController.h b/view/sharedcache/core/SharedCacheController.h
index caf61e41..3a6c76dc 100644
--- a/view/sharedcache/core/SharedCacheController.h
+++ b/view/sharedcache/core/SharedCacheController.h
@@ -35,11 +35,11 @@ namespace BinaryNinja::DSC {
bool m_processObjC;
bool m_processCFStrings;
- explicit SharedCacheController(SharedCache cache, Ref<Logger> logger);
+ explicit SharedCacheController(SharedCache&& cache, Ref<Logger> logger);
public:
// Initialize the DSCacheView, this should be called from the view initialize function only!
- static DSCRef<SharedCacheController> Initialize(BinaryView& view, SharedCache cache);
+ static DSCRef<SharedCacheController> Initialize(BinaryView& view, SharedCache&& cache);
// NOTE: This will not create one if it does not exist. To create one for the view call `Initialize`.
static DSCRef<SharedCacheController> FromView(BinaryView& view);