-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Proposal: Low level struct improvements #3936
Commits on Sep 23, 2020
-
Proposal: Low level struct improvements
This design covers adding the following features to C# for low level struct performance improvements: - Allowing `ref struct` to contain `ref` fields. - Allowing `struct` and `ref struct` to return `ref` to their fields. - Allowing safe fixed buffers for unmanaged and managed types. Note: the section on providing parameter escape notations is incomplete at this time. I will send a PR in the future once I finalize this portion. Feel free to still leave comments though.
Configuration menu - View commit details
-
Copy full SHA for 9dd6863 - Browse repository at this point
Copy the full SHA 9dd6863View commit details
Commits on Sep 24, 2020
-
Update proposals/low-level-struct-improvements.md
Co-authored-by: Ruikuan <liruikuan@outlook.com>
Configuration menu - View commit details
-
Copy full SHA for b83c02c - Browse repository at this point
Copy the full SHA b83c02cView commit details -
Apply suggestions from code review
Co-authored-by: Ruikuan <liruikuan@outlook.com>
Configuration menu - View commit details
-
Copy full SHA for 8fff276 - Browse repository at this point
Copy the full SHA 8fff276View commit details -
Apply suggestions from code review
Co-authored-by: Joseph Musser <me@jnm2.com>
Configuration menu - View commit details
-
Copy full SHA for 610ce4b - Browse repository at this point
Copy the full SHA 610ce4bView commit details
Commits on Sep 28, 2020
-
The name `[RefEscapes]` was causing a lot of confusion in the discussions. People were mis-interpretting it as a general feature that could apply to other constructs when in reality it's a very specific and targetted feature. Renaming to `[ThisRefEscapes]` to make it clear this is a very targetted feature.
Configuration menu - View commit details
-
Copy full SHA for 7af7ca3 - Browse repository at this point
Copy the full SHA 7af7ca3View commit details -
Make ref field assignment more flexible
Based on feedback from several people I've decided that we need to make the rules for `ref` fields more flexible when the values being passed around are known to refer to the heap. In those cases there is simply no reason to restrict the created `ref struct` as it is always *ref-safe-to-escape* to the enclosing method as well as not requiring any adjustment to the method invocation rules. This does mean that we need to add the notion of "refers to the heap" to the span safety document. That doesn't change any assumptions there. It's just that before this change the notion of "refers to the heap" wasn't necessary to describe our safety rules.
Configuration menu - View commit details
-
Copy full SHA for fbdda3c - Browse repository at this point
Copy the full SHA fbdda3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a34b6d7 - Browse repository at this point
Copy the full SHA a34b6d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for da1b2a4 - Browse repository at this point
Copy the full SHA da1b2a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67e7e40 - Browse repository at this point
Copy the full SHA 67e7e40View commit details