-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Simplify AssemblyName marshalling between VM and CoreLib #68735
Conversation
jkotas
commented
Apr 30, 2022
- Introduce NativeAssemblyNameParts that is unmanaged view for the managed AssemblyNameParts
- Use NativeAssemblyNameParts to convert manually managed code to C#
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue Details
|
123df0c
to
90c3209
Compare
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
|
||
AssemblyNameFlags flags = assemblyName.RawFlags; | ||
|
||
// Note that we prefer to take a public key token if present, |
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.
This is mirroring the logic that used to be in C++
src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs
Outdated
Show resolved
Hide resolved
b2e096c
to
0793a7e
Compare
This is contributing towards moving more of assembly loader to C#. The next step after this PR is going to switch assembly name parsing to be C# only and delete the C++ parser. |
src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs
Outdated
Show resolved
Hide resolved
9b1d81c
to
b8ccd39
Compare
- Introduce NativeAssemblyNameParts that is unmanaged view for the managed AssemblyNameParts - Use NativeAssemblyNameParts to convert manually managed code to C# - Delete unnecessary Version allocation
b8ccd39
to
a18c80e
Compare
This is ready for review. |
Please stop emailing me.
…Sent from my iPhone
On Apr 30, 2022, at 10:36 AM, Jan Kotas ***@***.***> wrote:
@jkotas commented on this pull request.
In src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs:
> @@ -46,7 +46,7 @@ public AssemblyName(string assemblyName)
}
if (parts._cultureName != null)
- _cultureInfo = new CultureInfo(parts._cultureName);
+ _cultureInfo = CultureInfo.GetCultureInfo(parts._cultureName);
CultureInfo.GetCultureInfo caches the CultureInfo instances. Avoids allocation and initialization costs.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
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.
LGTM!
Improvement: dotnet/perf-autofiling-issues#5076 |