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

Side by Side Diff: src/platform-cygwin.cc

Issue 12089107: Determine number of available cores on all platforms. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/platform.h ('k') | src/platform-freebsd.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); 170 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect);
171 } 171 }
172 172
173 173
174 void OS::Sleep(int milliseconds) { 174 void OS::Sleep(int milliseconds) {
175 unsigned int ms = static_cast<unsigned int>(milliseconds); 175 unsigned int ms = static_cast<unsigned int>(milliseconds);
176 usleep(1000 * ms); 176 usleep(1000 * ms);
177 } 177 }
178 178
179 179
180 int OS::NumberOfCores() {
181 return sysconf(_SC_NPROCESSORS_ONLN);
182 }
183
184
180 void OS::Abort() { 185 void OS::Abort() {
181 // Redirect to std abort to signal abnormal program termination. 186 // Redirect to std abort to signal abnormal program termination.
182 abort(); 187 abort();
183 } 188 }
184 189
185 190
186 void OS::DebugBreak() { 191 void OS::DebugBreak() {
187 asm("int $3"); 192 asm("int $3");
188 } 193 }
189 194
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 770
766 771
767 void Sampler::Stop() { 772 void Sampler::Stop() {
768 ASSERT(IsActive()); 773 ASSERT(IsActive());
769 SamplerThread::RemoveActiveSampler(this); 774 SamplerThread::RemoveActiveSampler(this);
770 SetActive(false); 775 SetActive(false);
771 } 776 }
772 777
773 778
774 } } // namespace v8::internal 779 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform.h ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698