Yair Halberstadt
Yair Halberstadt
Given that using variable length stackalloc is usually advised against (see https://vcsjones.dev/2020/02/24/stackalloc/. Linus Torvalds banned them from Linux for similar reasons) , making them easier to use is probably a...
A) If you validate your input, then converting to an int should be trivial. B) validating your input effectively means limiting the maximum size of your array to a small...
> As for variable length stack allocation I don't think that the .NET Core JIT optimises constant size stackalloc expressions so they shouldn't be any faster than variable size stackalloc....
> I never claimed doing it was difficult, it is just repetitive, frustrating, and useless. Consider: ```csharp if (size < 0 || size > 256) throw new ArgumentOutOfRangeException(size); Span span...
Maybe change it to ```csharp var p = stackalloc T[AssertCanStackalloc(size)]; ``` ? And it will do the annoying cast for you.
If this is a bug, this is a bug. However if this is to spec, given that a) VLAs are risky, a vector for security bugs, and of arguable benefit....
Would it be possible to add an example of what would be possible under plan A, but is not under plan B? Thanks
@Joe4Evr Was that meant to be `IBaz : IBar`?
In that case what's the difference between calling base(IFoo).M and call M directly? A case when IBar or IBaz hides M?
> how do you imagine this boxing would occur without the base(T) feature? When an interface is used as a type constraint...