Commit 2da1ad3e authored by Siddhartha's avatar Siddhartha Committed by Commit Bot

Use GetDefaultThreadStackSize() for mac sampling profiler

R=wittman@chromium.org

Change-Id: I171d11f25c2903894feb015adff53d6280a88be7
Reviewed-on: https://chromium-review.googlesource.com/c/1306496
Commit-Queue: ssid <ssid@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604722}
parent aa5bc110
......@@ -518,17 +518,11 @@ std::unique_ptr<NativeStackSampler> NativeStackSampler::Create(
// static
size_t NativeStackSampler::GetStackBufferSize() {
// In platform_thread_mac's GetDefaultThreadStackSize(), RLIMIT_STACK is used
// for all stacks, not just the main thread's, so it is good for use here.
struct rlimit stack_rlimit;
if (getrlimit(RLIMIT_STACK, &stack_rlimit) == 0 &&
stack_rlimit.rlim_cur != RLIM_INFINITY) {
return stack_rlimit.rlim_cur;
}
size_t stack_size = PlatformThread::GetDefaultThreadStackSize();
// If getrlimit somehow fails, return the default macOS main thread stack size
// of 8 MB (DFLSSIZ in <i386/vmparam.h>) with extra wiggle room.
return 12 * 1024 * 1024;
return stack_size > 0 ? stack_size : 12 * 1024 * 1024;
}
} // namespace base
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment