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

Remove or document Unsafe.AsPointer uses in core libraries #99146

Merged
merged 14 commits into from
Mar 5, 2024

Conversation

hamarb123
Copy link
Contributor

Contributes to #99144

- Also add internal helper method Unsafe.IsOpportunisticallyAligned
- And cast a pointer to IntPtr instead of int for a unit test
@ghost
Copy link

ghost commented Mar 1, 2024

Tagging subscribers to this area: @dotnet/area-system-memory
See info in area-owners.md if you want to be subscribed.

Issue Details

Contributes to #99144

Author: hamarb123
Assignees: -
Labels:

area-System.Memory

Milestone: -

@jkotas
Copy link
Member

jkotas commented Mar 1, 2024

Many tests are failing with

Should've been aligned on natural word boundary.
   at System.SpanHelpers.ClearWithReferences(IntPtr& ip, UIntPtr pointerSizeLength) in /_/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.cs:line 17

- Other than MethodHandle code for NativeAOT
- Add Unsafe.OpportunisticMisalignment
@hamarb123 hamarb123 changed the title Remove or document Unsafe.AsPointer uses in System.Memory Remove or document Unsafe.AsPointer uses in core libraries Mar 4, 2024
@hamarb123
Copy link
Contributor Author

hamarb123 commented Mar 4, 2024

I've skipped the code in NativeAOT's MethodHandle files, and QCallHandles (out of the core libraries)

@hamarb123
Copy link
Contributor Author

Should I include changes for the misc tests in this PR too?

@jkotas
Copy link
Member

jkotas commented Mar 4, 2024

Should I include changes for the misc tests in this PR too?

I would start a new PR for these.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks!

@jkotas jkotas merged commit 825bc44 into dotnet:main Mar 5, 2024
188 of 190 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2024
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.

7 participants