OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef StackUtil_h | 5 #ifndef StackUtil_h |
6 #define StackUtil_h | 6 #define StackUtil_h |
7 | 7 |
8 #include "wtf/Compiler.h" | 8 #include "platform/wtf/Compiler.h" |
9 #include "wtf/WTFExport.h" | 9 #include "platform/wtf/WTFExport.h" |
10 #include "wtf/build_config.h" | 10 #include "platform/wtf/build_config.h" |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
14 namespace WTF { | 14 namespace WTF { |
15 | 15 |
16 WTF_EXPORT size_t getUnderestimatedStackSize(); | 16 WTF_EXPORT size_t getUnderestimatedStackSize(); |
17 WTF_EXPORT void* getStackStart(); | 17 WTF_EXPORT void* getStackStart(); |
18 | 18 |
19 namespace internal { | 19 namespace internal { |
20 | 20 |
(...skipping 19 matching lines...) Expand all Loading... |
40 // This is a fast way to judge if we are in the main thread. | 40 // This is a fast way to judge if we are in the main thread. |
41 // If |&dummy| is within |s_mainThreadUnderestimatedStackSize| byte from | 41 // If |&dummy| is within |s_mainThreadUnderestimatedStackSize| byte from |
42 // the stack start of the main thread, we judge that we are in | 42 // the stack start of the main thread, we judge that we are in |
43 // the main thread. | 43 // the main thread. |
44 return addressDiff >= internal::s_mainThreadUnderestimatedStackSize; | 44 return addressDiff >= internal::s_mainThreadUnderestimatedStackSize; |
45 } | 45 } |
46 | 46 |
47 } // namespace WTF | 47 } // namespace WTF |
48 | 48 |
49 #endif // StackUtil_h | 49 #endif // StackUtil_h |
OLD | NEW |