News for hackers. Stuff that matters.
Re:Hardware Intrinsics in .NET 8 by lambda_garden on Tuesday December 19, 2023 @06:23AM (#38694308)
In C# you can create types where you control the layout and they are always stack allocated.
Re:Hardware Intrinsics in .NET 8 by vrighter on Wednesday December 20, 2023 @08:58AM (#38708731)
This is not really true, as far as I know. You can control the memory layout of structs, they can be allocated on the stack, because they're value types, but not necessarily.

If you, for example, create an array of said struct type, the array's memory will be on the heap. And the structs will be stored in it. You can't assume a struct will be on the stack.

Re:Hardware Intrinsics in .NET 8 by vrighter on Wednesday December 20, 2023 @09:02AM (#38708774)
nevermind... I was just out of date. C3 now has ref structs