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

Side by Side Diff: src/cpu.cc

Issue 300713002: Move NumberOfProcessorsOnline from CPU to OS (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/cpu.h ('k') | src/d8.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "cpu.h" 5 #include "cpu.h"
6 6
7 #if V8_LIBC_MSVCRT 7 #if V8_LIBC_MSVCRT
8 #include <intrin.h> // __cpuid() 8 #include <intrin.h> // __cpuid()
9 #endif 9 #endif
10 #if V8_OS_POSIX 10 #if V8_OS_POSIX
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 part_ = strtol(part, &end, 0); 489 part_ = strtol(part, &end, 0);
490 if (end == part) { 490 if (end == part) {
491 part_ = 0; 491 part_ = 0;
492 } 492 }
493 delete[] part; 493 delete[] part;
494 } 494 }
495 495
496 #endif 496 #endif
497 } 497 }
498 498
499
500 // static
501 int CPU::NumberOfProcessorsOnline() {
502 #if V8_OS_WIN
503 SYSTEM_INFO info;
504 GetSystemInfo(&info);
505 return info.dwNumberOfProcessors;
506 #else
507 return static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN));
508 #endif
509 }
510
511 } } // namespace v8::internal 499 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/cpu.h ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698