Skip to content
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

[class] Add GC Unsafe transitions to a few more external only functions #55748

Merged
merged 1 commit into from
Jul 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/mono/mono/metadata/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -2965,9 +2965,12 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext
MonoClass *
mono_class_get (MonoImage *image, guint32 type_token)
{
MonoClass *result;
MONO_ENTER_GC_UNSAFE;
ERROR_DECL (error);
MonoClass *result = mono_class_get_checked (image, type_token, error);
result = mono_class_get_checked (image, type_token, error);
mono_error_assert_ok (error);
MONO_EXIT_GC_UNSAFE;
return result;
}

Expand Down Expand Up @@ -4585,9 +4588,12 @@ gpointer
mono_ldtoken (MonoImage *image, guint32 token, MonoClass **handle_class,
MonoGenericContext *context)
{
gpointer res;
MONO_ENTER_GC_UNSAFE;
ERROR_DECL (error);
gpointer res = mono_ldtoken_checked (image, token, handle_class, context, error);
res = mono_ldtoken_checked (image, token, handle_class, context, error);
mono_error_assert_ok (error);
MONO_EXIT_GC_UNSAFE;
return res;
}

Expand Down Expand Up @@ -5283,7 +5289,11 @@ mono_class_is_delegate (MonoClass *klass)
mono_bool
mono_class_implements_interface (MonoClass* klass, MonoClass* iface)
{
return mono_class_is_assignable_from_internal (iface, klass);
mono_bool result;
MONO_ENTER_GC_UNSAFE;
result = mono_class_is_assignable_from_internal (iface, klass);
MONO_EXIT_GC_UNSAFE;
return result;
}

static mono_bool
Expand Down