From c910aa5a42fb789225bb58c990d077d39da9b4ce Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 31 Aug 2016 17:21:53 -0400 Subject: Cache lines on API side to avoid UI hangs with large basic blocks --- binaryninjaapi.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 6902c1a3..fed1bbd9 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1694,6 +1694,10 @@ namespace BinaryNinja class FunctionGraphBlock: public CoreRefCountObject { + std::vector m_cachedLines; + std::vector m_cachedEdges; + bool m_cachedLinesValid, m_cachedEdgesValid; + public: FunctionGraphBlock(BNFunctionGraphBlock* block); @@ -1705,14 +1709,15 @@ namespace BinaryNinja int GetWidth() const; int GetHeight() const; - std::vector GetLines() const; - std::vector GetOutgoingEdges() const; + const std::vector& GetLines(); + const std::vector& GetOutgoingEdges(); }; class FunctionGraph: public RefCountObject { BNFunctionGraph* m_graph; std::function m_completeFunc; + std::map> m_cachedBlocks; static void CompleteCallback(void* ctxt); @@ -1735,7 +1740,7 @@ namespace BinaryNinja void OnComplete(const std::function& func); void Abort(); - std::vector> GetBlocks() const; + std::vector> GetBlocks(); int GetWidth() const; int GetHeight() const; -- cgit v1.3.1