================
@@ -605,13 +616,20 @@ bool MCPseudoProbeDecoder::buildAddress2ProbeMap(
     TopLevelFuncs += !Discard;
   }
   assert(Data == End && "Have unprocessed data in pseudo_probe section");
+  PseudoProbeVec.reserve(ProbeCount);
+  InlineTreeVec.reserve(InlinedCount);
----------------
wlei-llvm wrote:

Since this assumes the vector's reserved size will be equal to the amount it 
will be used. How about adding assertions at the end of function. like 
`assert(InlineTreeVec.size() == InlinedCount && ...)` this is for checking any 
accidental re-allocation/extension of the vector during the build the map. 

https://github.com/llvm/llvm-project/pull/102789
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to