Follow-up work on shared allocation helpers

Open
#116,191 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
backend, compilers

Research direction

Start with PR #115339 and its linked review discussions, then inspect the RhpNewObjectArrayFast helper, the NativeAOT multi-dimensional array handling, and the x86 allocation helpers. The work is complete when the remaining checklist items are addressed, including the named threshold constant, correct arrays larger than 2 GB, and any validated x86 allocation improvements.

Written by the indexing model from the issue text.

Description

area-NativeAOT-coreclr

PR #115339 enables sharing of the allocation helpers written in assembly between CoreCLR and NativeAOT runtimes. This is a tracking issue for follow-up work that came up during review of the PR:

  • Change managed signatures of new array helpers to take nint (1)
  • Optimization: Enable the RhpNewObjectArrayFast helper on NativeAOT and teach JIT interface to use it.
  • Cleanup: Extract the 0x40000000 magic constant in RhpNewObjectArrayFast to a named constant like FAST_OBJECT_ARRAY_ALLOCATION_THRESHOLD (1)
  • Correctness: NativeAOT doesn't properly handle multi-dimensional arrays larger than 2 GB (1, 2, 3)
  • Optimization: Investigate and benchmark potential improvements to x86 allocation helpers (1)
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.