| Index: third_party/WebKit/Source/wtf/StackUtil.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/StackUtil.cpp b/third_party/WebKit/Source/wtf/StackUtil.cpp
|
| index f9e51b866b60fe64317289f43ee7783a86412b8f..0312ad8d8bd6a9f3fc45021445f5ce242d46e5d9 100644
|
| --- a/third_party/WebKit/Source/wtf/StackUtil.cpp
|
| +++ b/third_party/WebKit/Source/wtf/StackUtil.cpp
|
| @@ -143,13 +143,21 @@ void* getStackStart() {
|
|
|
| namespace internal {
|
|
|
| -uintptr_t mainThreadUnderestimatedStackSize() {
|
| +uintptr_t s_mainThreadStackStart = 0;
|
| +uintptr_t s_mainThreadUnderestimatedStackSize = 0;
|
| +
|
| +void initializeMainThreadStackEstimate() {
|
| + // getStackStart is exclusive, not inclusive (i.e. it points past the last
|
| + // page of the stack in linear order). So, to ensure an inclusive comparison,
|
| + // subtract here and below.
|
| + s_mainThreadStackStart =
|
| + reinterpret_cast<uintptr_t>(getStackStart()) - sizeof(void*);
|
| +
|
| size_t underestimatedStackSize = getUnderestimatedStackSize();
|
| - // See comment in mayNotBeMainThread as to why we subtract here.
|
| if (underestimatedStackSize > sizeof(void*)) {
|
| underestimatedStackSize = underestimatedStackSize - sizeof(void*);
|
| }
|
| - return underestimatedStackSize;
|
| + s_mainThreadUnderestimatedStackSize = underestimatedStackSize;
|
| }
|
|
|
| #if OS(WIN) && COMPILER(MSVC)
|
|
|