-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mono C# low-level struct feature support #48113
Comments
Tagging subscribers to this area: @CoffeeFlux Issue DetailsSee #46014. Basically there are two new C#10 language features tht we need to support.
|
.NET 8 work continues in #80798 |
See #46104. Basically there are two new C#1language features that we need to support.
ref
fields inref
structs, and fixed size buffers of any type. (See C# and CoreCLR issues in the linked issue).ref
fields inref
structs. Consume Roslyn withref
fields support #71498For Mono due to conservative stack scanning, it is likely that the only additional work for
ref
fields is to verify that we don't rejectref
fields during loading and class initialization.safe fixed size buffers
(This is in flux pending the outcome of the[API Proposal]: InlineArrayAttribute #61135FixSizedBufferAttribute
proposal Expose an attribute to allow sizing a fixed sized buffer based on type and element count. #12320).The approach with
InlineArrayAttribute
is to modify the struct layout algorithm to adjust the inferred size of a single-field struct to contain space for N extra copies of the field. Also the GC descriptor will need to be array-like.The rest is based on the proposed translation in https://github.com/dotnet/csharplang/blob/master/proposals/fixed-sized-buffers.mdThe proposed translation relies on creating a generic struct type with potentially thousands of fields.~ - [ ] First cut at support: Just verify that class layout and initialization don't perform pathologically on such giant declarations.~
~ - [ ] Second cut at support: Look for the
FixedBufferAttribute
on the field declaration and synthesize the class layout for the defining class without initializing the underlying thousand-field struct.~- [ ] Stretch goal: Ideally also compile the indexer in the struct without doing class layout. (This is hard)The text was updated successfully, but these errors were encountered: