-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add MemoryMarshal.GetArrayDataReference(Array) #53562
Add MemoryMarshal.GetArrayDataReference(Array) #53562
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @tannergooding Issue DetailsResolves #35528. This PR has a few distinct components:
/cc @buyaa-n, I thought this might interest you because it touches metasig.h, which you and I discussed a few weeks back. In this case, I'm introducing two signatures to metasig.h: one which takes a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoreCLR part LGTM. Thanks!
The mono changes look ok. |
@jkotas I thought I saw feedback from you earlier that I should add |
Sorry for the confusion. I have deleted that feedback. |
Latest iteration:
|
Resolves #35528.
This PR has a few distinct components:
Array.GetArrayDataReference(Array array)
. I opted to name the parameter array instead of arr for local consistency with the existing overload.GetRawSzArrayData
andGetRawArrayData
internal methods and migrate their callers to the new public APIs./cc @buyaa-n, I thought this might interest you because it touches metasig.h, which you and I discussed a few weeks back. In this case, I'm introducing two signatures to metasig.h: one which takes a
T[]
and returns aref T
, and one which takes anArray
and returns aref byte
. Note the use ofDEFINE_METASIG_T
instead ofDEFINE_METASIG
for theArray
-consuming method. This is because we use the syntaxC(ARRAY)
, which specifically refers to theSystem.Array
class, and per comments at the very top of file, you need to use the _T version of the macro if you want to refer to specific classes. These new definitions are then used in corelib.h.