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

Side by Side Diff: src/platform-freebsd.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-cygwin.cc ('k') | src/platform-linux.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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 ASSERT(result == 0); 174 ASSERT(result == 0);
175 } 175 }
176 176
177 177
178 void OS::Sleep(int milliseconds) { 178 void OS::Sleep(int milliseconds) {
179 unsigned int ms = static_cast<unsigned int>(milliseconds); 179 unsigned int ms = static_cast<unsigned int>(milliseconds);
180 usleep(1000 * ms); 180 usleep(1000 * ms);
181 } 181 }
182 182
183 183
184 int OS::NumberOfCores() {
185 return sysconf(_SC_NPROCESSORS_ONLN);
186 }
187
188
184 void OS::Abort() { 189 void OS::Abort() {
185 // Redirect to std abort to signal abnormal program termination. 190 // Redirect to std abort to signal abnormal program termination.
186 abort(); 191 abort();
187 } 192 }
188 193
189 194
190 void OS::DebugBreak() { 195 void OS::DebugBreak() {
191 #if (defined(__arm__) || defined(__thumb__)) 196 #if (defined(__arm__) || defined(__thumb__))
192 # if defined(CAN_USE_ARMV5_INSTRUCTIONS) 197 # if defined(CAN_USE_ARMV5_INSTRUCTIONS)
193 asm("bkpt 0"); 198 asm("bkpt 0");
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 892
888 893
889 void Sampler::Stop() { 894 void Sampler::Stop() {
890 ASSERT(IsActive()); 895 ASSERT(IsActive());
891 SignalSender::RemoveActiveSampler(this); 896 SignalSender::RemoveActiveSampler(this);
892 SetActive(false); 897 SetActive(false);
893 } 898 }
894 899
895 900
896 } } // namespace v8::internal 901 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-cygwin.cc ('k') | src/platform-linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698