[Lldb-commits] [PATCH] D30942: Remove some ProcFileReader occurences
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 15 03:46:12 PDT 2017
labath added inline comments.
================
Comment at: source/Host/linux/Host.cpp:166
+ llvm::SmallString<64> ProcExe;
+ (llvm::Twine("/proc/") + llvm::Twine(pid) + "/exe").toVector(ProcExe);
+ llvm::SmallString<0> ExePath;
----------------
labath wrote:
> zturner wrote:
> > You can make this a bit shorter with `((llvm::Twine("/proc") + pid) + "/exe").toVector(ProcExe);`
> ok
Actually, that doesn't work as Twine's integral constructors are explicit.
================
Comment at: source/Host/linux/Host.cpp:167
+ (llvm::Twine("/proc/") + llvm::Twine(pid) + "/exe").toVector(ProcExe);
+ llvm::SmallString<0> ExePath;
+ ExePath.assign(PATH_MAX, '\0');
----------------
eugene wrote:
> std::string? Do we have any benefits from using 0 size stack allocated string here?
Not really, I was trying to be consistent with the `ProcExe` variable above, but I did not want to allocate PATH_MAX on the stack. I'll change it to std::string, hopefully that looks less weird.
https://reviews.llvm.org/D30942
More information about the lldb-commits
mailing list