anton.kolesov added inline comments.

================
Comment at: lldb/tools/lldb-mi/MICmdCmdData.cpp:419
+      // Get a full path to the file.
+      std::unique_ptr<char[]> pPathBuffer(new char[PATH_MAX]);
+      lineEntry.GetFileSpec().GetPath(pPathBuffer.get(), PATH_MAX);
----------------
clayborg wrote:
> Confused as to why we are calling malloc and free here for pPathBuffer? Why 
> not just:
> ```
> char pPathBuffer[PATH_MAX];
> ```
I don't have a strong opinion on this, so to maintain consistency in the code 
I'm trying to use what other code in lldb-mi uses in similar situations - which 
is either unique_ptr or static local variable, but I presume it was decided 
that second approach is not good. FWIW, If I were to write code without regard 
of what is being done in the same project, then I would never ever had a 
variable named "miValueConst5".


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59015/new/

https://reviews.llvm.org/D59015



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to