Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[objcruntime] Do not pre-compute the
Selector.Name
property (#12518)
it's not often required. Delaying it's retrieval allows the linker to remove additional code (and lower the memory for each selector) if the app's code never uses the selector name. ```diff @@ -2990,8 +2985,6 @@ { private IntPtr handle; - private string name; - public IntPtr Handle => handle; public Selector(IntPtr P_0) @@ -3001,13 +2994,11 @@ ThrowHelper.ThrowArgumentException("sel", "Not a selector handle."); } handle = P_0; - name = GetName(P_0); } internal Selector(IntPtr P_0, bool P_1) { handle = P_0; - name = GetName(P_0); } public sealed override bool Equals(object? P_0) @@ -3029,14 +3020,6 @@ return handle.GetHashCode(); } - internal static string GetName(IntPtr P_0) - { - return Marshal.PtrToStringAuto(sel_getName(P_0)); - } - - [DllImport("/usr/lib/libobjc.dylib")] - private static extern IntPtr sel_getName(IntPtr P_0); - [DllImport("/usr/lib/libobjc.dylib", EntryPoint = "sel_registerName")] public static extern IntPtr GetHandle(string P_0); ```
- Loading branch information
207285a
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.
❌ [CI Build] Tests failed on Build ❌
Tests failed on Build.
API diff
✅ API Diff from stable
View API diff
API & Generator diff
✅ API Diff (from PR only) (no change)
✅ Generator Diff (only version changes)
Packages generated
View packages
Test results
1 tests failed, 248 tests passed.
Failed tests
Pipeline on Agent XAMBOT-1033.BigSur'
[objcruntime] Do not pre-compute the
Selector.Name
property (#12518)207285a
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.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[objcruntime] Do not pre-compute the
Selector.Name
property (#12518)207285a
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.
❌ Tests failed on macOS M1 - Mac Big Sur (11.5) ❌
Tests failed on M1 - Mac Big Sur (11.5).
Failed tests are:
Pipeline on Agent
[objcruntime] Do not pre-compute the
Selector.Name
property (#12518)207285a
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.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[objcruntime] Do not pre-compute the
Selector.Name
property (#12518)207285a
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.
✅ Tests passed on macOS Mac Mojave (10.14) ✅
Tests passed
All tests on macOS X Mac Mojave (10.14) passed.
Pipeline on Agent
[objcruntime] Do not pre-compute the
Selector.Name
property (#12518)