-
-
Notifications
You must be signed in to change notification settings - Fork 58
net7 cleanup and fix broken pinned/unmanaged flag detection #74
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eerhardt
reviewed
May 2, 2023
eerhardt
reviewed
May 2, 2023
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
eerhardt
approved these changes
May 3, 2023
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.
Nice work! This is awesome. Thanks for making this library AOT-compatible.
|
Re function pointers: partly perf, partly to avoid having to declare the
type etc (can't use generics with spans), partly because they rock
…On Wed, 3 May 2023, 16:01 Eric Erhardt, ***@***.***> wrote:
***@***.**** approved this pull request.
Nice work! This is awesome. Thanks for making this library AOT-compatible.
------------------------------
In tests/AotTests/AotTests.csproj
<#74 (comment)>
:
> @@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>net7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <PublishAot>true</PublishAot>
+
⬇️ Suggested change
-
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
------------------------------
In src/Pipelines.Sockets.Unofficial/Arenas/PerTypeHelpers.cs
<#74 (comment)>
:
> + Cast = (delegate*<Span<TFrom>, Span<TTo>>)concrete.MethodHandle.GetFunctionPointer();
+ }
+ //Cast = (CastHelper)Delegate.CreateDelegate(typeof(CastHelper), null, concrete);
(for my learning) Why function pointers here instead of a normal delegate?
—
Reply to this email directly, view it on GitHub
<#74 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEHMDNCPKCCGDDSWQLXTDXEJXNJANCNFSM6AAAAAAXTE2UUA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
# Conflicts: # src/Pipelines.Sockets.Unofficial/Delegates.cs
|
v2.2.8 should be available |
|
Thanks! I've been studying this and your other projects @mgravell to improve the RabbitMQ .NET client. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


the primary change here is to make AOT work, by removing any ref-emit, evil poking, or usage of
MakeGenericType/MakeGenericMethod. This last required removing someT : unmanagedconstraints (which is why we were using generics, because those scenarios couldn't be known statically), instead using evilness to keep things working - not least, a re-implementation ofMemoryMarshal.Cast<TFrom, TTo>without theTFrom : struct, TTo : structconstraints (runtime checked, though) usingMemoryMarshal.CreateSpan(note: on down-level TFMs, usesMakeGenericMethodto use the inbuiltCastmethod, but that's fine: we don't need AOT on those platforms)also: