Skip to content
Closed
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/mono/mono/component/marshal-ilgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ marshal_ilgen_available (void)

static MonoComponentMarshalILgen component_func_table = {
{ MONO_COMPONENT_ITF_VERSION, &marshal_ilgen_available },
&mono_marshal_ilgen_init,
&mono_marshal_ilgen_init_internal,
&mono_emit_marshal_ilgen,
&mono_marshal_ilgen_install_callbacks_mono
};
Expand Down Expand Up @@ -2750,7 +2750,7 @@ get_marshal_cb (void)
{
if (G_UNLIKELY (!ilgen_cb_inited)) {
#ifdef ENABLE_ILGEN
mono_marshal_ilgen_init ();
mono_marshal_ilgen_init_internal ();
#else
mono_marshal_noilgen_init_heavyweight ();
#endif
Expand Down Expand Up @@ -2835,7 +2835,7 @@ mono_emit_marshal_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
}

void
mono_marshal_ilgen_init (void)
mono_marshal_ilgen_init_internal (void)
{
MonoMarshalILgenCallbacks cb;
cb.version = MONO_MARSHAL_CALLBACKS_VERSION;
Expand Down
6 changes: 3 additions & 3 deletions src/mono/mono/component/marshal-ilgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

typedef struct MonoComponentMarshalILgen {
MonoComponent component;
void (*ilgen_init) (void);
void (*ilgen_init_internal) (void);
int (*emit_marshal_ilgen) (EmitMarshalContext *m, int argnum, MonoType *t,
MonoMarshalSpec *spec, int conv_arg,
MonoType **conv_arg_type, MarshalAction action, MonoMarshalLightweightCallbacks* lightweigth_cb);
Expand Down Expand Up @@ -42,8 +42,8 @@ MonoComponentMarshalILgen* mono_component_marshal_ilgen_init (void);
void
mono_install_marshal_callbacks_ilgen (MonoMarshalILgenCallbacks *cb);

MONO_API void
mono_marshal_ilgen_init (void);
void
mono_marshal_ilgen_init_internal (void);

int
mono_emit_marshal_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
Expand Down
11 changes: 11 additions & 0 deletions src/mono/mono/metadata/marshal-lightweight.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ get_method_image (MonoMethod *method)
return m_class_get_image (method->klass);
}



MONO_API void
mono_marshal_ilgen_init (void)
{
/* Some platforms need this initilization to happen early, some can wait for it lazily.*/
#ifndef ENABLE_ILGEN
mono_component_marshal_ilgen ()->ilgen_init_internal();
#endif
}

/**
* mono_mb_strdup:
* \param mb the MethodBuilder
Expand Down
3 changes: 3 additions & 0 deletions src/mono/mono/metadata/marshal-lightweight.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
MONO_API void
mono_marshal_lightweight_init (void);

MONO_API void
mono_marshal_ilgen_init (void);

#endif // __MONO_MARSHAL_LIGHTWEIGHT_H__