diff options
author | mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com> | 2015-05-04 11:29:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-04 18:30:34 +0000 |
commit | 4839a142bf95776323647c82ca9dc0725f7c4f15 (patch) | |
tree | e8544d9f66e60db96de0683ed570038eb8fcbca5 /remoting | |
parent | ac322f81dff6cd124c0dd114c0b4e573fbab5455 (diff) | |
download | chromium_src-4839a142bf95776323647c82ca9dc0725f7c4f15.zip chromium_src-4839a142bf95776323647c82ca9dc0725f7c4f15.tar.gz chromium_src-4839a142bf95776323647c82ca9dc0725f7c4f15.tar.bz2 |
Avoid unnecessary memory allocations at PlatformThread::SetName()
The PlatformThread::SetName() method used to accept 'name' parameter
as 'const char*' even though all the clients stored as 'std::string' and
thus had to convert, further inside PlatformThread::SetName() it was
converted back to 'std::string' (when passing to ThreadIdNameManager::SetName())
leading to unnecessary memory allocations.
See also: https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ
Review URL: https://codereview.chromium.org/1093223007
Cr-Commit-Position: refs/heads/master@{#328157}
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/base/auto_thread.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/remoting/base/auto_thread.cc b/remoting/base/auto_thread.cc index 2e5006b..514b82f 100644 --- a/remoting/base/auto_thread.cc +++ b/remoting/base/auto_thread.cc @@ -183,7 +183,7 @@ void AutoThread::ThreadMain() { base::MessageLoop message_loop(startup_data_->loop_type); // Complete the initialization of our AutoThread object. - base::PlatformThread::SetName(name_.c_str()); + base::PlatformThread::SetName(name_); ANNOTATE_THREAD_NAME(name_.c_str()); // Tell the name to race detector. message_loop.set_thread_name(name_); |