Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference#5118

Merged
ahsonkhan merged 2 commits into
dotnet:masterfrom
ahsonkhan:RemoveUseOfDanger
Dec 15, 2017
Merged

Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference#5118
ahsonkhan merged 2 commits into
dotnet:masterfrom
ahsonkhan:RemoveUseOfDanger

Conversation

@ahsonkhan
Copy link
Copy Markdown
Contributor

Part of:
https://github.com/dotnet/corefx/issues/25412
https://github.com/dotnet/corefx/issues/25615

Related to: dotnet/coreclr#15532

I am not making the changes to the shared section since they will get mirrored from the PR above.

Following the staging plan from here: https://github.com/dotnet/corefx/issues/23881#issuecomment-343767740

  • Add MemoryExtensions.GetReference/TryGetArray
  • Convert all uses of DangerousGetPinnableReference/DangerousTryGetArray in coreclr, corefx, corert, corefxlab, aspnet, ... to MemoryExtensions.GetReference
  • Change DangerousGetPinnableReference to whatever we like to make it fit the pinning pattern and remove DangerousTryGetArray.

Doing it this way will avoid the need for complex staging or things being on the floor for extensive periods of time.

cc @jkotas, @KrzysztofCwalina, @stephentoub

@ahsonkhan ahsonkhan self-assigned this Dec 15, 2017
@ahsonkhan ahsonkhan merged commit f300629 into dotnet:master Dec 15, 2017
@ahsonkhan ahsonkhan deleted the RemoveUseOfDanger branch December 15, 2017 11:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant