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

Unified Diff: base/threading/worker_pool_posix.cc

Issue 2640803002: [base] Increase worker_pool thread stacksize to 1MB on MacOSX. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_posix.cc
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index afa9a5044f5ded76b86c444c5bca8084bc921df5..3fef463ae1d92ae8c5a20430ceba831d01d18f1a 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -30,6 +30,14 @@ base::LazyInstance<ThreadLocalBoolean>::Leaky
const int kIdleSecondsBeforeExit = 10 * 60;
+#if defined(OS_MACOSX)
+// On MacOSX a background thread's default stack size is 512KB. We need at least
Mark Mentovai 2017/01/23 23:02:13 macOS, OS X, or Mac OS X. and kB :)
rmcilroy 2017/01/24 14:52:25 Done.
+// 1MB for compilation tasks in V8, so increase this default.
+const int kDefaultStackSize = 1 * 1024 * 1024;
Mark Mentovai 2017/01/23 23:02:13 Don’t call it kDefaultStackSize, because it’s not
rmcilroy 2017/01/24 14:52:25 Done.
+#else
+const int kDefaultStackSize = 0;
+#endif
+
class WorkerPoolImpl {
public:
WorkerPoolImpl();
@@ -146,7 +154,7 @@ void PosixDynamicThreadPool::AddTask(PendingTask* pending_task) {
// The new PlatformThread will take ownership of the WorkerThread object,
// which will delete itself on exit.
WorkerThread* worker = new WorkerThread(name_prefix_, this);
- PlatformThread::CreateNonJoinable(0, worker);
+ PlatformThread::CreateNonJoinable(kDefaultStackSize, worker);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698