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

Side by Side Diff: src/platform-macos.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-linux.cc ('k') | src/platform-nullos.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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 USE(result); 164 USE(result);
165 ASSERT(result == 0); 165 ASSERT(result == 0);
166 } 166 }
167 167
168 168
169 void OS::Sleep(int milliseconds) { 169 void OS::Sleep(int milliseconds) {
170 usleep(1000 * milliseconds); 170 usleep(1000 * milliseconds);
171 } 171 }
172 172
173 173
174 int OS::NumberOfCores() {
175 return sysconf(_SC_NPROCESSORS_ONLN);
176 }
177
178
174 void OS::Abort() { 179 void OS::Abort() {
175 // Redirect to std abort to signal abnormal program termination 180 // Redirect to std abort to signal abnormal program termination
176 abort(); 181 abort();
177 } 182 }
178 183
179 184
180 void OS::DebugBreak() { 185 void OS::DebugBreak() {
181 asm("int $3"); 186 asm("int $3");
182 } 187 }
183 188
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 916
912 917
913 void Sampler::Stop() { 918 void Sampler::Stop() {
914 ASSERT(IsActive()); 919 ASSERT(IsActive());
915 SamplerThread::RemoveActiveSampler(this); 920 SamplerThread::RemoveActiveSampler(this);
916 SetActive(false); 921 SetActive(false);
917 } 922 }
918 923
919 924
920 } } // namespace v8::internal 925 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-nullos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698