Mark key allocating methods noinline, otherwise they may get inlined
under jit stress and leave jit temps referring to allocations that the test
expects should be collectible.
Resolves dotnet/coreclr#19218.
Commit migrated from https://github.com/dotnet/coreclr/commit/
268a6b777febf10e97badede96dcddd54b54c4e1
<ExcludeList Include="$(XunitTestBinBase)/GC/Features/HeapExpansion/pluggaps/*">
<Issue>needs triage</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/GC/Features/Finalizer/finalizeother/finalizearray/*">
- <Issue>19218</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/GC/Features/Finalizer/finalizeother/finalizearraysleep/*">
- <Issue>19218</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/GC/Regressions/v2.0-beta2/460373/460373/*">
<Issue>needs triage</Issue>
</ExcludeList>
{
public Dummy[] obj;
+ // No inline to ensure no stray refs to the new array
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
public CreateObj() {
obj = new Dummy[10000];
for(int i=0;i<10000;i++) {
public Dummy[] obj;
public int ExitCode = 0;
+ // No inline to ensure no stray refs to the new array
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
public CreateObj() {
obj = new Dummy[10];
Dummy obj;
#pragma warning restore 0414
+ // No inline to ensure no stray refs to the Dummy object
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
public CreateObj()
{
obj = new Dummy();
public class CreateObj {
public Dummy obj;
+ // No inline to ensure no stray refs to the Dummy object
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
public CreateObj() {
obj = new Dummy();
}
#pragma warning restore 0414
C c;
+ // No inline to ensure no stray refs to the B, C, D objects.
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
public CreateObj()
{
b = new B();