summaryrefslogtreecommitdiff
path: root/functiongraphblock.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2018-01-14 03:42:04 -0500
committerPeter LaFosse <peter@vector35.com>2018-03-23 17:10:06 -0400
commit5f263139ad405f0ecd751f40ccb103e966c2ae64 (patch)
treef18377d2f54f6d203c529df592610dce3bef4002 /functiongraphblock.cpp
parent86da0eb0216f0d778cce9885ea16588c0a2b0728 (diff)
Container Memory Reservations.
Diffstat (limited to 'functiongraphblock.cpp')
-rw-r--r--functiongraphblock.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/functiongraphblock.cpp b/functiongraphblock.cpp
index 20b2515b..06a35eee 100644
--- a/functiongraphblock.cpp
+++ b/functiongraphblock.cpp
@@ -89,10 +89,12 @@ const vector<DisassemblyTextLine>& FunctionGraphBlock::GetLines()
BNDisassemblyTextLine* lines = BNGetFunctionGraphBlockLines(m_object, &count);
vector<DisassemblyTextLine> result;
+ result.reserve(count);
for (size_t i = 0; i < count; i++)
{
DisassemblyTextLine line;
line.addr = lines[i].addr;
+ line.tokens.reserve(lines[i].count);
for (size_t j = 0; j < lines[i].count; j++)
{
InstructionTextToken token;
@@ -125,6 +127,7 @@ const vector<FunctionGraphEdge>& FunctionGraphBlock::GetOutgoingEdges()
BNFunctionGraphEdge* edges = BNGetFunctionGraphBlockOutgoingEdges(m_object, &count);
vector<FunctionGraphEdge> result;
+ result.reserve(count);
for (size_t i = 0; i < count; i++)
{
FunctionGraphEdge edge;