Skip to content

Commit

Permalink
Merge branch 'dotnet:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
PWagner1 authored May 5, 2024
2 parents ba5fe78 + c926856 commit f4a59b4
Show file tree
Hide file tree
Showing 165 changed files with 8,698 additions and 817 deletions.
19 changes: 19 additions & 0 deletions Winforms.sln
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComDisabled.Tests", "src\Sy
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TrimTestBinaryDeserialization", "src\System.Windows.Forms\tests\IntegrationTests\TrimTestBinaryDeserialization\TrimTestBinaryDeserialization.csproj", "{CFBCC732-C988-4FE7-A21B-98A142365374}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BinaryFormatTests", "src\System.Private.Windows.Core\tests\BinaryFormatTests\BinaryFormatTests.csproj", "{57EC5288-9513-46CF-8FB7-626199690D90}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -963,6 +965,22 @@ Global
{CFBCC732-C988-4FE7-A21B-98A142365374}.Release|x64.Build.0 = Release|Any CPU
{CFBCC732-C988-4FE7-A21B-98A142365374}.Release|x86.ActiveCfg = Release|Any CPU
{CFBCC732-C988-4FE7-A21B-98A142365374}.Release|x86.Build.0 = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|arm64.ActiveCfg = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|arm64.Build.0 = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|x64.ActiveCfg = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|x64.Build.0 = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|x86.ActiveCfg = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Debug|x86.Build.0 = Debug|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|Any CPU.Build.0 = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|arm64.ActiveCfg = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|arm64.Build.0 = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|x64.ActiveCfg = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|x64.Build.0 = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|x86.ActiveCfg = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1025,6 +1043,7 @@ Global
{61376D2A-4AD5-48F4-BF99-2BB630E21945} = {77FEDB47-F7F6-490D-AF7C-ABB4A9E0B9D7}
{55F3174F-C1FE-4C8F-AF71-2512630088F8} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC}
{CFBCC732-C988-4FE7-A21B-98A142365374} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}
{57EC5288-9513-46CF-8FB7-626199690D90} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136}
Expand Down
24 changes: 12 additions & 12 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,29 +183,29 @@ Note: if the Uri is a new place, you will need to add a subscription from that p
</ProductDependencies>
<ToolsetDependencies>
<!-- Arcade -->
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24229.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24253.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>be933308b9024d798a9a22c0b8f3c8e3616ffbd8</Sha>
<Sha>020255bcf7d0b8beed7de05338d97396982ae527</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenFacades" Version="9.0.0-beta.24229.1">
<Dependency Name="Microsoft.DotNet.GenFacades" Version="9.0.0-beta.24253.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>be933308b9024d798a9a22c0b8f3c8e3616ffbd8</Sha>
<Sha>020255bcf7d0b8beed7de05338d97396982ae527</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CMake.Sdk" Version="9.0.0-beta.24229.1">
<Dependency Name="Microsoft.DotNet.CMake.Sdk" Version="9.0.0-beta.24253.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>be933308b9024d798a9a22c0b8f3c8e3616ffbd8</Sha>
<Sha>020255bcf7d0b8beed7de05338d97396982ae527</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.24229.1">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.24253.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>be933308b9024d798a9a22c0b8f3c8e3616ffbd8</Sha>
<Sha>020255bcf7d0b8beed7de05338d97396982ae527</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.24229.1">
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.24253.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>be933308b9024d798a9a22c0b8f3c8e3616ffbd8</Sha>
<Sha>020255bcf7d0b8beed7de05338d97396982ae527</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.24229.1">
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.24253.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>be933308b9024d798a9a22c0b8f3c8e3616ffbd8</Sha>
<Sha>020255bcf7d0b8beed7de05338d97396982ae527</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
</PropertyGroup>
<!-- Arcade -->
<PropertyGroup>
<MicrosoftDotNetGenFacadesPackageVersion>9.0.0-beta.24229.1</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.24229.1</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>9.0.0-beta.24229.1</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftDotNetGenFacadesPackageVersion>9.0.0-beta.24253.1</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.24253.1</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>9.0.0-beta.24253.1</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion>
</PropertyGroup>
<!-- Below have no corresponding entries in Versions.Details.XML because they are not updated via Maestro -->
Expand Down
2 changes: 1 addition & 1 deletion eng/common/native/init-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if [ -z "$CLR_CC" ]; then
if [ -z "$majorVersion" ]; then
# note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
if [ "$compiler" = "clang" ]; then versions="18 17 16 15 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5"
elif [ "$compiler" = "gcc" ]; then versions="13 12 11 10 9 8 7 6 5 4.9"; fi
elif [ "$compiler" = "gcc" ]; then versions="14 13 12 11 10 9 8 7 6 5 4.9"; fi

for version in $versions; do
_major="${version%%.*}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ steps:
${{ if parameters.args.artifactName }}:
artifactName: ${{ parameters.args.artifactName }}
${{ if parameters.args.properties }}:
properties: ${{ properties.args.properties }}
properties: ${{ parameters.args.properties }}
2 changes: 1 addition & 1 deletion eng/common/templates/steps/publish-pipeline-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ steps:
${{ if parameters.args.parallelCount }}:
parallelCount: ${{ parameters.args.parallelCount }}
${{ if parameters.args.properties }}:
properties: ${{ properties.args.properties }}
properties: ${{ parameters.args.properties }}
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"version": "9.0.100-preview.3.24204.13"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24229.1",
"Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24229.1",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24229.1",
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24253.1",
"Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24253.1",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24253.1",
"FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0",
"Microsoft.NET.Sdk.IL": "9.0.0-preview.4.24230.15"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[assembly: InternalsVisibleTo("System.Windows.Forms.Primitives.Tests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Primitives.TestUtilities, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Tests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("BinaryFormatTests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.TestUtilities, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.UI.IntegrationTests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Interop.Tests, PublicKey=00000000000000000400000000000000")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.CompilerServices;

namespace System.Collections.Generic;

/// <summary>
/// Array based collection that tries to avoid copying the internal array and caps the maximum capacity.
/// </summary>
/// <remarks>
/// <para>
/// To mitigate corrupted length attacks, the backing array has an initial allocation size cap.
/// </para>
/// </remarks>
internal class ArrayBuilder<T>
{
private const int MaxInitialArrayLength = 1024 * 10;

private T[] _items;
private readonly int _maxCount;
private int _count;

/// <param name="expectedCount">
/// The <see cref="_count"/> cannot grow past this value and is expected to be this value
/// when the collection is "finished".
/// </param>
internal ArrayBuilder(int expectedCount)
{
_items = new T[Math.Min(expectedCount, MaxInitialArrayLength)];
_maxCount = expectedCount;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Add(T item)
{
T[] array = _items;
int count = _count;
if ((uint)count < (uint)_items.Length)
{
_count = count + 1;
array[count] = item;
}
else
{
AddWithResize(item);
}
}

private void AddWithResize(T item)
{
if (_items.Length == _maxCount)
{
throw new ArgumentOutOfRangeException(nameof(item), "Collection is at max capacity.");
}

Debug.Assert(_count == _items.Length);
int size = _count;

Debug.Assert(_items.Length > 0);
int newCapacity = Math.Min(_maxCount, 2 * _items.Length);

Array.Resize(ref _items, newCapacity);
_count = size + 1;
_items[size] = item;
}

public T[] ToArray()
{
Debug.Assert(_count == _maxCount);
Debug.Assert(_count == _items.Length);

return _items;
}
}
Loading

0 comments on commit f4a59b4

Please sign in to comment.