Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/gc/card_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void gc_heap::get_card_table_element_layout (uint8_t* start, uint8_t* end, size_
for (int element = brick_table_element; element <= total_bookkeeping_elements; element++)
{
layout[element] = layout[element - 1] + sizes[element - 1];
if ((element != total_bookkeeping_elements) && (sizes[element] != 0))
if (element != total_bookkeeping_elements)
{
layout[element] = ALIGN_UP(layout[element], alignment[element]);
}
Expand Down
53 changes: 53 additions & 0 deletions src/tests/GC/Regressions/Github/Runtime_129681/Runtime_129681.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

public class Runtime_129681
{
private const int StorageLength = 8192;

[Fact]
public static void TestEntryPoint()
{
object[] storage = new object[StorageLength];
int index = 0;

try
{
while (index < storage.Length)
{
storage[index++] = GC.AllocateArray<byte>(16 * 1024, pinned: true);
}
}
catch (OutOfMemoryException)
{
}

try
{
while (index < storage.Length)
{
storage[index++] = GC.AllocateArray<byte>(256, pinned: true);
}
}
catch (OutOfMemoryException)
{
}

try
{
while (index < storage.Length)
{
storage[index++] = GC.AllocateArray<byte>(1, pinned: true);
}
}
catch (OutOfMemoryException)
{
return;
}

throw new Exception("The configured GC heap hard limit was not reached.");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RequiresProcessIsolation>true</RequiresProcessIsolation>
<CLRTestPriority>1</CLRTestPriority>
<DisableProjectBuild Condition="'$(RuntimeFlavor)' == 'mono'">true</DisableProjectBuild>

<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
set DOTNET_GCStress=0xC
set DOTNET_GCHeapHardLimit=0x4000000
set DOTNET_GCRegionRange=0x4000000
set DOTNET_GCRegionSize=0x100000
]]></CLRTestBatchPreCommands>
<CLRTestBashPreCommands><![CDATA[
$(CLRTestBashPreCommands)
export DOTNET_GCStress=0xC
export DOTNET_GCHeapHardLimit=0x4000000
export DOTNET_GCRegionRange=0x4000000
export DOTNET_GCRegionSize=0x100000
]]></CLRTestBashPreCommands>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
Loading