clayborg added inline comments.

================
Comment at: lldb/source/Utility/Log.cpp:323-324
   if (options.Test(LLDB_LOG_OPTION_THREADSAFE)) {
     static std::recursive_mutex g_LogThreadedMutex;
     std::lock_guard<std::recursive_mutex> guard(g_LogThreadedMutex);
+    handler_sp->Emit(message);
----------------
Since we are improving stuff here, should we add a mutex to each handler and 
use the handler specific mutex if needed?


================
Comment at: lldb/source/Utility/Log.cpp:325
     std::lock_guard<std::recursive_mutex> guard(g_LogThreadedMutex);
-    *stream_sp << message;
-    stream_sp->flush();
+    handler_sp->Emit(message);
+    handler_sp->Flush();
----------------
Will this copy the string? The Emit() calls take a "std::string", maybe we 
should switch it to "const std::string &" to avoid any copies?


================
Comment at: lldb/source/Utility/Log.cpp:328
   } else {
-    *stream_sp << message;
-    stream_sp->flush();
+    handler_sp->Emit(message);
+    handler_sp->Flush();
----------------
Ditto


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

https://reviews.llvm.org/D127922

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

Reply via email to