Register g_free icall regular, as monoeg_g_free. (mono/mono#14044)
authorJay Krell <jay.krell@cornell.edu>
Tue, 16 Apr 2019 11:34:29 +0000 (04:34 -0700)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 16 Apr 2019 11:34:29 +0000 (13:34 +0200)
The point here is that register_dyn is a bit obscure and could use clarification.

Commit migrated from https://github.com/mono/mono/commit/6225a9b031fd9d70d23cbb0139b471238e7616f5

src/mono/mono/metadata/marshal-ilgen.c
src/mono/mono/metadata/marshal.c

index 405a414..31f9e9c 100644 (file)
@@ -702,7 +702,7 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv
                pos = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S);
                mono_mb_emit_ldloc (mb, 1);
                mono_mb_emit_byte (mb, CEE_LDIND_I);
-               mono_mb_emit_icall (mb, g_free);
+               mono_mb_emit_icall (mb, g_free); // aka monoeg_g_free
                mono_mb_patch_short_branch (mb, pos);
 
                mono_mb_emit_ldloc (mb, 1);
index 262a3c0..4f32758 100644 (file)
@@ -265,7 +265,8 @@ mono_marshal_init (void)
                register_icall (mono_marshal_free_array, "mono_marshal_free_array", mono_icall_sig_void_ptr_int32, FALSE);
                register_icall (mono_string_to_byvalstr, "mono_string_to_byvalstr", mono_icall_sig_void_ptr_ptr_int32, FALSE);
                register_icall (mono_string_to_byvalwstr, "mono_string_to_byvalwstr", mono_icall_sig_void_ptr_ptr_int32, FALSE);
-               register_dyn_icall (g_free, "g_free", mono_icall_sig_void_ptr, FALSE);
+               // Because #define g_free monoeg_g_free.
+               register_icall (g_free, "monoeg_g_free", mono_icall_sig_void_ptr, FALSE);
                register_icall_no_wrapper (mono_object_isinst_icall, "mono_object_isinst_icall", mono_icall_sig_object_object_ptr);
                register_icall (mono_struct_delete_old, "mono_struct_delete_old", mono_icall_sig_void_ptr_ptr, FALSE);
                register_icall (mono_delegate_begin_invoke, "mono_delegate_begin_invoke", mono_icall_sig_object_object_ptr, FALSE);