-
Notifications
You must be signed in to change notification settings - Fork 514
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
[runtime] Allow IntPtr
for native objects in the dynamic registrar. Fixes #15708
#15712
Changes from 1 commit
9f8efd0
2714bd6
7992750
d213b21
14b4d7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,13 @@ | |
} | ||
} | ||
} else { | ||
xamarin_assertion_message ("Don't know how to marshal a return value of type '%s.%s'. Please file a bug with a test case at https://github.com/xamarin/xamarin-macios/issues/new\n", mono_class_get_namespace (r_klass), mono_class_get_name (r_klass)); | ||
char *fullname = xamarin_class_get_full_name (r_klass, exception_gchandle); | ||
if (!strcmp (fullname, "System.IntPtr")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two functions that are much faster and simpler: |
||
returnValue = *(void **) mono_object_unbox (retval); | ||
} else { | ||
xamarin_assertion_message ("Don't know how to marshal a return value of type '%s.%s'. Please file a bug with a test case at https://github.com/xamarin/xamarin-macios/issues/new\n", mono_class_get_namespace (r_klass), mono_class_get_name (r_klass)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you have the On a side note, I wonder if this won't be immediately stale with the .NET 6 transition to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both good points @stephen-hawley I'll address them shortly. Thanks! |
||
} | ||
xamarin_free (fullname); | ||
} | ||
|
||
xamarin_mono_object_release (&r_klass); | ||
|
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.
last little bit - since
fullname
is only used in the error and @rolfbjarne implies that it's more costly than thexamarin_is_class_
tests, how about moving the allocation and deallocation into theelse
clause so that the price only gets paid in the failing case.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.
I reverted the assertion to the original code as it did not need (extra) allocation, inside the caller, and still produced the same output.