Skip to content

Commit dbf79fc

Browse files
Feedback
Co-authored-by: Andy Ayers <andya@microsoft.com>
1 parent dff2971 commit dbf79fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

release-notes/10.0/preview/preview1/runtime.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ This code shape is easy for the JIT to optimize, mainly because there aren't any
3232
static int Sum(int[] array)
3333
{
3434
int sum = 0;
35-
IList<int> temp = array;
35+
IEnumerable<int> temp = array;
36+
3637
foreach (var num in temp)
3738
{
3839
sum += num;
@@ -49,7 +50,10 @@ In Preview 1, the JIT can now devirtualize and inline array interface methods, t
4950

5051
In .NET 9, the JIT gained the ability to allocate objects on the stack, when the object is guaranteed to not outlive its parent method. Not only does stack allocation reduce the number of objects the GC has to track, but it also unlocks other optimizations: For example, after an object has been stack-allocated, the JIT can consider replacing it entirely with its scalar values. Because of this, stack allocation is key to reducing the abstraction penalty of reference types.
5152

52-
In Preview 1, thanks to [contributions](https://github.com/dotnet/runtime/pull/104906) from @hez2010, the JIT will now stack-allocate arrays of value types that don't contain GC pointers when it can make the same lifetime guarantees described above. Among other [stack allocation enhancements](https://github.com/dotnet/runtime/issues/104936), we plan to expand this ability to arrays of reference types in the coming previews.
53+
In Preview 1, thanks to [contributions](https://github.com/dotnet/runtime/pull/104906) from @hez2010, the JIT will now stack-allocate small fixed-sized arrays of value types that don't contain GC pointers when it can make the same lifetime guarantees described above. Among other [stack allocation enhancements](https://github.com/dotnet/runtime/issues/104936), we plan to expand this ability to arrays of reference types in the coming previews.
54+
55+
56+
5357

5458
## AVX10.2 Support
5559

0 commit comments

Comments
 (0)