Skip to content
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

Update SafeHandle types to have public parameterless constructors and add InitHandle API #47189

Merged
5 commits merged into from
Jan 20, 2021

Conversation

jkoritzinsky
Copy link
Member

@jkoritzinsky jkoritzinsky commented Jan 19, 2021

Implements the API changes described in #46830.

Make all non-abstract SafeHandle types have public parameterless constructors. Add the InitHandle API that initializes the underlying handle of the SafeHandle object.

Contributes to #46830

See #45633 for linker context.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

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.

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I would also add a test for the new Marshal API.

@AaronRobinsonMSFT
Copy link
Member

/cc @eerhardt

…ors.

Remove now-unneeded ILLink trim files.

Make public abstract SafeHandle constructors protected.

Remove comment on SafeWaitHandle
@jkoritzinsky jkoritzinsky force-pushed the safehandle-apis branch 2 times, most recently from 790c886 to cdb9780 Compare January 19, 2021 23:37
Make internal abstract SafeHandle default constructors protected. Make non-abstract internal SafeHandles sealed when possible.

More internal SafeHandle types.
Fix SetHandle accessibility

Fix test.

Use Marshal.InitHandle.
@jkoritzinsky
Copy link
Member Author

@eerhardt @stephentoub any more changes needed?

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just missed a couple sealed classes.

@ghost
Copy link

ghost commented Jan 20, 2021

Hello @jkoritzinsky!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 3cbdf4c into dotnet:master Jan 20, 2021
@jkoritzinsky jkoritzinsky deleted the safehandle-apis branch January 21, 2021 19:29
@ghost ghost locked as resolved and limited conversation to collaborators Feb 20, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants