Skip to content

Conversation

@333fred
Copy link
Member

@333fred 333fred commented Mar 12, 2025

Description

Closes #111973. Implements the API as proposed.

Closes #111973. Implements the API as proposed.
Copilot AI review requested due to automatic review settings March 12, 2025 00:37
@ghost
Copy link

ghost commented Mar 12, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost added needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners new-api-needs-documentation labels Mar 12, 2025
@ghost
Copy link

ghost commented Mar 12, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a set of InlineArrayX types (from InlineArray2 to InlineArray15) as proposed to support optimized inline array storage.

  • Added new InlineArrayX structs in both implementation and reference assemblies
  • Added tests verifying element assignment and access across the new inline array types

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/InlineArrayTests.cs Added tests covering basic indexing operations for each InlineArray type
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/InlineArray.cs Implemented InlineArrayX structs with the InlineArray attribute
src/libraries/System.Runtime/ref/System.Runtime.cs Updated reference definitions to include the new InlineArrayX types
Comments suppressed due to low confidence (1)

src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/InlineArrayTests.cs:12

  • Consider adding tests for out-of-range index access to ensure that the InlineArray types throw appropriate exceptions or handle invalid indices as expected.
public void InlineArray2Test()

@stephentoub
Copy link
Member

Thanks

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@stephentoub
Copy link
Member

/ba-g net timeouts

@stephentoub stephentoub merged commit 890de13 into main Mar 12, 2025
136 of 140 checks passed
@stephentoub stephentoub deleted the inline-array-types branch March 12, 2025 11:17
@am11 am11 removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 9, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Predefined InlineArrayX<T> types up to some X

4 participants