<div dir="ltr"><div dir="ltr">Ah, thanks!<br><br>Could it be taken a step further and statically allocated instead of dynamically allocated? <br>Replacing:<br><span class="gmail-pl-k gmail-x gmail-x-first" style="box-sizing:border-box;color:rgb(36,41,46);border-top-left-radius:0.2em;border-bottom-left-radius:0.2em;background-color:rgb(172,242,189);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre">auto</span><span class="gmail-x gmail-x-last" style="box-sizing:border-box;border-top-right-radius:0.2em;border-bottom-right-radius:0.2em;color:rgb(36,41,46);background-color:rgb(172,242,189);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre"> </span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre;background-color:rgb(230,255,237)">Costs = </span><span class="gmail-x gmail-x-first gmail-x-last" style="box-sizing:border-box;border-radius:0.2em;color:rgb(36,41,46);background-color:rgb(172,242,189);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre">std::make_unique<</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre;background-color:rgb(230,255,237)">OutlinerCosts</span><span class="gmail-x gmail-x-first gmail-x-last" style="box-sizing:border-box;border-radius:0.2em;color:rgb(36,41,46);background-color:rgb(172,242,189);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre">></span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre;background-color:rgb(230,255,237)">(Subtarget);</span><br></div>with:<br>OutlinerCosts Costs(Subtarget);<br><br>?<br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 18, 2020 at 11:36 PM Yvan Roux <<a href="mailto:yvan.roux@linaro.org">yvan.roux@linaro.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi David,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 18 May 2020 at 21:50, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Any chance of using unique_ptr (or non-dynamic allocation), etc, to simplify this memory management?</div></blockquote><div><br></div><div>Yes I replaced it by make_unique shorty after this commit here:</div><div><a href="https://github.com/llvm/llvm-project/commit/3648dde3ddd3cc0ba862017d494b7ede6054631c" target="_blank">https://github.com/llvm/llvm-project/commit/3648dde3ddd3cc0ba862017d494b7ede6054631c</a> </div><div><br></div><div>Cheers,</div><div>Yvan</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 15, 2020 at 7:27 AM Yvan Roux via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Yvan Roux<br>
Date: 2020-05-15T16:27:14+02:00<br>
New Revision: 96c4460a0be6f5f66a02eac7fe796e49768001a4<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/96c4460a0be6f5f66a02eac7fe796e49768001a4" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/96c4460a0be6f5f66a02eac7fe796e49768001a4</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/96c4460a0be6f5f66a02eac7fe796e49768001a4.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/96c4460a0be6f5f66a02eac7fe796e49768001a4.diff</a><br>
<br>
LOG: [ARM][MachineOutliner] Fix memory leak.<br>
<br>
Fix sanitizer bots after 0e4827aa4e4ae25813f66d3b872db67d93813009<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
index c160843fcdba..20df55f55bc8 100644<br>
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
@@ -5668,6 +5668,7 @@ outliner::OutlinedFunction ARMBaseInstrInfo::getOutliningCandidateInfo(<br>
   } else<br>
     return outliner::OutlinedFunction();<br>
<br>
+  delete Costs;<br>
   return outliner::OutlinedFunction(RepeatedSequenceLocs, SequenceSize,<br>
                                     NumBytesToCreateFrame, FrameID);<br>
 }<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div></div>
</blockquote></div></div>