Skip to content

Conversation

fanyang-mono
Copy link
Member

@fanyang-mono fanyang-mono commented Jul 19, 2024

Fixes #101495

The implementation of Unsafe.BitCast was extracted from #103915

Copy link
Contributor

Tagging subscribers to this area: @lambdageek, @steveisok
See info in area-owners.md if you want to be subscribed.

@xtqqczze
Copy link
Contributor

Make sure to add comments to Unsafe.cs, e.g. // Mono:SubtractByteOffset as below:

// CoreCLR:METHOD__UNSAFE__AS_POINTER
// AOT:AsPointer
// Mono:AsPointer
[NonVersionable]
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void* AsPointer<T>(ref T value)

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

The Add/Subtract and Read/Write changes LGTM

BitCast also LGTM, but I'm probably not the right person to review that since I wrote some of the code in a previous prototype

@fanyang-mono
Copy link
Member Author

runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs

This seems to be a very fragile way of keeping track which methods are intrinsified by each runtime. We probably should come up a better way of doing it.

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.

[mono] Intrinsify Unsafe API's

4 participants