diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-09-09 02:45:11 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-09-09 02:45:11 +0300 |
commit | 7066ee85c055a55248943d033c46a6c95254efea (patch) | |
tree | b1d2d5a4d2a441ba2266dd02a8ff2939896465f2 /src/Native/Runtime/thread.inl | |
parent | 2a26179271a1d86450c6069a456e6e7f35a44782 (diff) |
Port EnsureSufficientExecutionStack/TryEnsureSufficientExecutionStack
- Port EnsureSufficientExecutionStack to Unix by switching it to the same implementation as what we use for CoreCLR. It is piggy backing on stackbounds that the runtime keeps track of.
- Add TryEnsureSufficientExecutionStack since it was added as public method for CoreCLR (see https://github.com/dotnet/coreclr/pull/7077/)
[tfs-changeset: 1626388]
Diffstat (limited to 'src/Native/Runtime/thread.inl')
-rw-r--r-- | src/Native/Runtime/thread.inl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Native/Runtime/thread.inl b/src/Native/Runtime/thread.inl index ec7cf53c8..9c33ae3f7 100644 --- a/src/Native/Runtime/thread.inl +++ b/src/Native/Runtime/thread.inl @@ -17,3 +17,16 @@ inline void Thread::SetupHackPInvokeTunnel() m_pHackPInvokeTunnel = m_pTransitionFrame; } #endif // DACCESS_COMPILE + +inline bool Thread::IsWithinStackBounds(PTR_VOID p) +{ + ASSERT((m_pStackLow != 0) && (m_pStackHigh != 0)); + return (m_pStackLow <= p) && (p < m_pStackHigh); +} + +inline void Thread::GetStackBounds(PTR_VOID * ppStackLow, PTR_VOID * ppStackHigh) +{ + ASSERT((m_pStackLow != 0) && (m_pStackHigh != 0)); + *ppStackLow = m_pStackLow; + *ppStackHigh = m_pStackHigh; +} |