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); |
} |
} |