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

Unified Diff: src/libplatform/default-platform.cc

Issue 252683004: Reland 20962 "Break cyclic reference between utils and platform." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/libplatform/default-platform.h ('k') | src/platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libplatform/default-platform.cc
diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc
index 1e21ca4e82379b6734d54e6d9f77b50bedab61e9..decfbeabcbe38e5e03d8d92038b5016e092a34f5 100644
--- a/src/libplatform/default-platform.cc
+++ b/src/libplatform/default-platform.cc
@@ -27,6 +27,7 @@
#include "default-platform.h"
+#include <algorithm>
#include <queue>
// TODO(jochen): We should have our own version of checks.h.
@@ -39,6 +40,9 @@ namespace v8 {
namespace internal {
+const int DefaultPlatform::kMaxThreadPoolSize = 4;
+
+
DefaultPlatform::DefaultPlatform()
: initialized_(false), thread_pool_size_(0) {}
@@ -60,7 +64,8 @@ void DefaultPlatform::SetThreadPoolSize(int thread_pool_size) {
ASSERT(thread_pool_size >= 0);
if (thread_pool_size < 1)
thread_pool_size = CPU::NumberOfProcessorsOnline();
- thread_pool_size_ = Max(Min(thread_pool_size, kMaxThreadPoolSize), 1);
+ thread_pool_size_ =
+ std::max(std::min(thread_pool_size, kMaxThreadPoolSize), 1);
}
« no previous file with comments | « src/libplatform/default-platform.h ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698