Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ff7731c

Browse files
bartdesmetjkotas
authored andcommitted
Make TryEnsureSufficientExecutionStack public (#7077)
1 parent 9a84564 commit ff7731c

File tree

5 files changed

+4
-11
lines changed

5 files changed

+4
-11
lines changed

src/mscorlib/model.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6316,6 +6316,7 @@
63166316
<Type Name="System.Runtime.CompilerServices.RuntimeHelpers">
63176317
<Member Name="GetUninitializedObject(System.Type)" />
63186318
<Member Name="EnsureSufficientExecutionStack" />
6319+
<Member Name="TryEnsureSufficientExecutionStack" />
63196320
<Member Name="get_OffsetToStringData" />
63206321
<Member Name="GetObjectValue(System.Object)" />
63216322
<Member Name="InitializeArray(System.Array,System.RuntimeFieldHandle)" />

src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,14 @@ public static int OffsetToStringData
188188
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
189189
public static extern void EnsureSufficientExecutionStack();
190190

191-
#if FEATURE_CORECLR
192191
// This method ensures that there is sufficient stack to execute the average Framework function.
193192
// If there is not enough stack, then it return false.
194193
// Note: this method is not part of the CER support, and is not to be confused with ProbeForSufficientStack
195194
// below.
196195
[System.Security.SecuritySafeCritical]
197196
[MethodImplAttribute(MethodImplOptions.InternalCall)]
198197
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
199-
internal static extern bool TryEnsureSufficientExecutionStack();
200-
#endif
198+
public static extern bool TryEnsureSufficientExecutionStack();
201199

202200
[System.Security.SecurityCritical] // auto-generated_required
203201
[MethodImplAttribute(MethodImplOptions.InternalCall)]

src/vm/ecalllist.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,9 +1843,7 @@ FCFuncStart(gCompilerFuncs)
18431843
FCFuncElement("GetHashCode", ObjectNative::GetHashCode)
18441844
FCFuncElement("Equals", ObjectNative::Equals)
18451845
FCFuncElement("EnsureSufficientExecutionStack", ReflectionInvocation::EnsureSufficientExecutionStack)
1846-
#ifdef FEATURE_CORECLR
18471846
FCFuncElement("TryEnsureSufficientExecutionStack", ReflectionInvocation::TryEnsureSufficientExecutionStack)
1848-
#endif // FEATURE_CORECLR
18491847
FCFuncEnd()
18501848

18511849
FCFuncStart(gContextSynchronizationFuncs)

src/vm/reflectioninvocation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,6 @@ FCIMPL0(void, ReflectionInvocation::EnsureSufficientExecutionStack)
26372637
}
26382638
FCIMPLEND
26392639

2640-
#ifdef FEATURE_CORECLR
26412640
// As with EnsureSufficientExecutionStack, this method checks and returns whether there is
26422641
// sufficient stack to execute the average Framework method, but rather than throwing,
26432642
// it simply returns a Boolean: true for sufficient stack space, otherwise false.
@@ -2654,7 +2653,6 @@ FCIMPL0(FC_BOOL_RET, ReflectionInvocation::TryEnsureSufficientExecutionStack)
26542653
FC_RETURN_BOOL(current >= limit);
26552654
}
26562655
FCIMPLEND
2657-
#endif // FEATURE_CORECLR
26582656

26592657
struct ECWGCFContext
26602658
{

src/vm/reflectioninvocation.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ class ReflectionInvocation {
5656
#endif // !FEATURE_CORECLR
5757
static FCDECL1(void, PrepareContractedDelegate, Object* delegateUNSAFE);
5858
static FCDECL0(void, ProbeForSufficientStack);
59-
static FCDECL0(void, EnsureSufficientExecutionStack);
60-
#ifdef FEATURE_CORECLR // currently only used from mscorlib in FEATURE_CORECLR
61-
static FCDECL0(FC_BOOL_RET, TryEnsureSufficientExecutionStack);
62-
#endif // FEATURE_CORECLR
59+
static FCDECL0(void, EnsureSufficientExecutionStack);
60+
static FCDECL0(FC_BOOL_RET, TryEnsureSufficientExecutionStack);
6361
static FCDECL3(void, ExecuteCodeWithGuaranteedCleanup, Object* pCodeDelegateUNSAFE, Object* pBackoutDelegateUNSAFE, Object* pUserDataUNSAFE);
6462

6563
// TypedReference functions, should go somewhere else

0 commit comments

Comments
 (0)