You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I think that this should be allowed, stackalloc object[10] should not mean to allocate 10 objects on the stack, it should mean to allocate 10 object references on the stack (all initialized to null).
I have posted this proposal in csharplang repo(dotnet/csharplang#3294), but someone told me this is a runtime issue, because the corresponding IL instruction only supports struct now. So I think this proposal need CLR support.
The text was updated successfully, but these errors were encountered:
If the runtime becomes capable of stack allocating references, this should just work with the normal stackalloc keyword. #25423 would not include that work.
ghost
locked as resolved and limited conversation to collaborators
Dec 10, 2020
Currently the following code is disallowed:
But I think that this should be allowed, stackalloc object[10] should not mean to allocate 10 objects on the stack, it should mean to allocate 10 object references on the stack (all initialized to null).
I have posted this proposal in csharplang repo(dotnet/csharplang#3294), but someone told me this is a runtime issue, because the corresponding IL instruction only supports struct now. So I think this proposal need CLR support.
The text was updated successfully, but these errors were encountered: