Avoid using std::string in Max OS platform file.

Review URL: http://codereview.chromium.org/6001012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6145 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
sgjesse@chromium.org 2011-01-04 11:02:39 +00:00
parent b85ac2465f
commit 1dc835a53a

View File

@ -52,8 +52,6 @@
#include <stdlib.h>
#include <errno.h>
#include <string>
#undef MAP_TYPE
#include "v8.h"
@ -437,9 +435,10 @@ static void SetThreadName(const char* name) {
return;
// Mac OS X does not expose the length limit of the name, so hardcode it.
const int kMaxNameLength = 63;
std::string shortened_name = std::string(name).substr(0, kMaxNameLength);
dynamic_pthread_setname_np(shortened_name.c_str());
static const int kMaxNameLength = 63;
USE(kMaxNameLength);
ASSERT(kMaxThreadNameLength <= kMaxNameLength);
dynamic_pthread_setname_np(name);
}