Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: src/base/platform/platform-posix.cc

Issue 1118533003: Make CPU profiler do not hog 100% of CPU. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: still uploading Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/base/platform/platform.h ('k') | src/base/platform/platform-win32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Platform-specific code for POSIX goes here. This is not a platform on its 5 // Platform-specific code for POSIX goes here. This is not a platform on its
6 // own, but contains the parts which are the same across the POSIX platforms 6 // own, but contains the parts which are the same across the POSIX platforms
7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX.
8 8
9 #include <errno.h> 9 #include <errno.h>
10 #include <limits.h> 10 #include <limits.h>
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 #endif 212 #endif
213 return reinterpret_cast<void*>(raw_addr); 213 return reinterpret_cast<void*>(raw_addr);
214 } 214 }
215 215
216 216
217 size_t OS::AllocateAlignment() { 217 size_t OS::AllocateAlignment() {
218 return static_cast<size_t>(sysconf(_SC_PAGESIZE)); 218 return static_cast<size_t>(sysconf(_SC_PAGESIZE));
219 } 219 }
220 220
221 221
222 void OS::Sleep(int milliseconds) { 222 void OS::Sleep(TimeDelta interval) {
223 useconds_t ms = static_cast<useconds_t>(milliseconds); 223 usleep(static_cast<useconds_t>(interval.InMicroseconds()));
224 usleep(1000 * ms);
225 } 224 }
226 225
227 226
228 void OS::Abort() { 227 void OS::Abort() {
229 if (g_hard_abort) { 228 if (g_hard_abort) {
230 V8_IMMEDIATE_CRASH(); 229 V8_IMMEDIATE_CRASH();
231 } 230 }
232 // Redirect to std abort to signal abnormal program termination. 231 // Redirect to std abort to signal abnormal program termination.
233 abort(); 232 abort();
234 } 233 }
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 748
750 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { 749 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
751 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); 750 pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
752 int result = pthread_setspecific(pthread_key, value); 751 int result = pthread_setspecific(pthread_key, value);
753 DCHECK_EQ(0, result); 752 DCHECK_EQ(0, result);
754 USE(result); 753 USE(result);
755 } 754 }
756 755
757 } // namespace base 756 } // namespace base
758 } // namespace v8 757 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/platform/platform.h ('k') | src/base/platform/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698