[Lldb-commits] [PATCH] Fetch module specification from remote process also

Greg Clayton clayborg at gmail.com
Mon Mar 23 13:17:42 PDT 2015

Its mainly an efficiency thing. If you have a std::string you might need to allocate data on the heap to store the string just to make the call. Since this argument is a path, it is more likely to have to allocate on the heap. Most std::string implementations store the first 20 some bytes in the std::string itself, but if it goes over, it will need to malloc a buffer for the string and make a copy. Most path arguments in the standard libraries and in functions already take "const char *" for paths, so it is just keeping the argument in the currency that most people want is good. I also don't like llvm::StringRef for the path because if you want to guarantee NULL terminate you will need to call my_str.str().c_str() which makes a temp std::string using the length, so I do think "const char *" is the best for the API.



More information about the lldb-commits mailing list