linux-packaging-mono/docs/deploy/mono-api-internal.html

1127 lines
39 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="us-ascii"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mono-api-internal.html</title>
<style type="text/css">
.mapi-docs {
line-height: 1.5;
padding-left: 2em;
padding-right: 2em;
}
.mapi-docs p {
max-width: 60em;
}
.mapi-docs .mapi-body {
max-width: 60em;
}
.mapi-docs code {
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.5em;
}
.mapi-description code {
font-family: "Consolas", "Courier", monospace;
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.2em;
}
.mapi-header {
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-code {
padding: 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-code:first-line {
line-height: 0px;
}
.mapi-codeblock {
display: block;
padding: 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-entry code {
border: none;
background-color: transparent;
}
.mapi-parameters {
border-collapse: collapse;
border-spacing: 0;
empty-cells: hide;
border: 0;
margin: 5px 0 26px;
}
.mapi-parameters td {
border: 1px solid rgba(214,214,214,1);
border-left-style: none;
padding: 5px 25px 5px 10px;
}
.mapi-parameters tr>td:last-child {
border-right: 0;
}
.mapi-parameters td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi-parameters tr:last-child>td {
border-bottom: 0;
}
.mapi-parameters tr:first-child>td {
border-top: 0;
}
.mapi-parameters tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi {
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-description {
background: rgba(249,249,249,1);
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-entry {
background: transparent;
}
.mapi-docs {
}
.mapi-prototype {
border-left: 5px solid rgba(205,233,244,1);
padding: .5em;
margin-top: 5pt;
margin-bottom: 5pt;
font-family: "Consolas", "Courier", monospace;
display: block;
overflow: auto;
background-color: #f9f9f9;
}
.mapi-declaration {
margin-top: 21px;
}
.mapi-section {
font-size: smaller;
font-weight: bold;
margin-top: 21px;
line-height: 1.5;
}
.mapi-strike {
text-decoration: line-through;
}
.mapi-deprecated {
color: red;
}
.mapi-ptr-container {
background: white;
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
padding-left: 25px;
padding-right: 25px;
padding-bottom: 13px;
position: relative;
width: 100%;
}
.mapi-ptr {
background: rgba(249,249,249,1);
border-left: 1px solid rgba(233,233,233,1);
border-top: 1px solid rgba(233,233,233,1);
height: 12px;
left: 37px;
top: -7px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
width: 12px;
}
.mapi-height-container {
left: -25px;
padding: 0 25px;
position: relative;
width: 100%;
}
</style>
</head>
<body>
<div class="mapi-docs">
<h1>Mono Internals</h1>
<p />This section documents some of the internal APIs used
inside Mono that developers extending or altering Mono might
want to use.
<h2>Strings</h2>
<h3>Other Encodings</h3>
<p />These routines are used when coping with strings that come
from Mono's environment, and might be encoded in one or more
of the external encodings.
<p />For example, some file systems might historically contain a
mix of file names with both old and new encodings, typically
UTF8 for new files, and the old files would be encoded in an 8
bit character set (ISO-8859-1 for example).
<p />These routines try a number of encodings, those specified
in the <tt>MONO_ENCODINGS</tt> environment variable and return
unicode strings that can be used internally.
<p />See the mono(1) man page for more details.
<a name="api:mono_unicode_from_external"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_unicode_from_external</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">gunichar2*
mono_unicode_from_external (const gchar *in, gsize *bytes)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>in</i></td><td> pointers to the buffer.</td></tr><tr><td><i>bytes</i></td><td> number of bytes in the string.</td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
Tries to turn a <code>NULL</code>-terminated string into UTF-16.
<p />
First, see if it's valid UTF-8, in which case just turn it directly
into UTF-16. Next, run through the colon-separated encodings in
<code>MONO_EXTERNAL_ENCODINGS</code> and do an <code>iconv</code> conversion on each,
returning the first successful conversion to UTF-16. If no
conversion succeeds, return <code>NULL</code>.
<p />
Callers must free the returned string if not <code>NULL</code>. <i>bytes</i> holds the number
of bytes in the returned string, not including the terminator.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_unicode_to_external"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_unicode_to_external</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">gchar*mono_unicode_to_external (const gunichar2 *uni)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>uni</i></td><td> a UTF-16 string to convert to an external representation.</td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
Turns <code>NULL</code>-terminated UTF-16 into either UTF-8, or the first
working item in <code>MONO_EXTERNAL_ENCODINGS</code> if set. If no conversions
work, then UTF-8 is returned.
Callers must free the returned string.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_utf8_from_external"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_utf8_from_external</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">gchar*mono_utf8_from_external (const gchar *in)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>in</i></td><td> pointer to the string buffer.</td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
Tries to turn a <code>NULL</code>-terminated string into UTF8.
<p />
First, see if it's valid UTF-8, in which case there's nothing more
to be done. Next, run through the colon-separated encodings in
<code>MONO_EXTERNAL_ENCODINGS</code> and do an <code>iconv</code> conversion on each,
returning the first successful conversion to UTF-8. If no
conversion succeeds, return <code>NULL</code>.
<p />
Callers must free the returned string if not <code>NULL</code>.
<p />
This function is identical to <code>mono_unicode_from_external</code>, apart
from returning UTF-8 not UTF-16; it's handy in a few places to work
in UTF-8.</div>
</div><!--mapi-description -->
</div><!--height container -->
<h2>Marshalling functions</h2>
</div> <!-- class=mapi -->
<a name="api:mono_marshal_alloc"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_alloc</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void*
mono_marshal_alloc (gsize size, MonoError *error)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_asany"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_asany</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">static gpointer
mono_marshal_asany_handle (MonoObjectHandle o, MonoMarshalNative string_encoding, int param_attrs, MonoError *error)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
This is a JIT icall, it sets the pending exception and returns <code>NULL</code> on error.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_free_array"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_free_array</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_marshal_free_array (gpointer *ptr, int size)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_free_asany"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_free_asany</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_encoding, int param_attrs)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
This is a JIT icall, it sets the pending exception</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_free"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_free</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_marshal_free (gpointer ptr)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_castclass"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_castclass</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">mono_marshal_get_castclass</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_delegate_begin_invoke"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_delegate_begin_invoke</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_delegate_begin_invoke (MonoMethod *method)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_delegate_end_invoke"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_delegate_end_invoke</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_delegate_end_invoke (MonoMethod *method)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_delegate_invoke"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_delegate_invoke</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
The returned method invokes all methods in a multicast delegate.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_icall_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_icall_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_icall_wrapper (MonoMethodSignature *sig, const char *name, gconstpointer func, gboolean check_exceptions)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
Generates IL code for the icall wrapper. The generated method
calls the unmanaged code in <i>func</i>.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_isinst"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_isinst</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">mono_marshal_get_isinst</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_ldfld_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_ldfld_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_ldfld_wrapper (MonoType *type)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>type</i></td><td> the type of the field</td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
<p />
This method generates a function which can be use to load a field with type
<i>type</i> from an object. The generated function has the following signature:
<p />
<code><i>type</i> ldfld_wrapper (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, int offset)</code></div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_managed_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_managed_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t target_handle, MonoError *error)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
Generates IL code to call managed methods from unmanaged code
If <i>target_handle</i> is <code>0</code>, the wrapper info will be a <code>WrapperInfo</code> structure.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_native_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_native_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions, gboolean aot)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>method</i></td><td> The <code>MonoMethod</code> to wrap.</td></tr><tr><td><i>check_exceptions</i></td><td> Whenever to check for pending exceptions</td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
<p />
Generates IL code for the pinvoke wrapper. The generated method
calls the unmanaged code in <code>piinfo-&gt;addr</code>.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_proxy_cancast"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_proxy_cancast</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_proxy_cancast (MonoClass *klass)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_ptr_to_struct"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_ptr_to_struct</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_ptr_to_struct (MonoClass *klass)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>klass</i></td><td> <code>MonoClass</code></td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
Generates IL code for <code>PtrToStructure (IntPtr src, object structure)</code></div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_remoting_invoke_for_target"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_remoting_invoke_for_target</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_remoting_invoke_for_target (MonoMethod *method, MonoRemotingTarget target_type, MonoError *error)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_remoting_invoke"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_remoting_invoke</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_remoting_invoke (MonoMethod *method, MonoError *error)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_remoting_invoke_with_check"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_remoting_invoke_with_check</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_remoting_invoke_with_check (MonoMethod *method, MonoError *error)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_runtime_invoke"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_runtime_invoke</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_runtime_invoke_full (MonoMethod *method, gboolean virtual_, gboolean need_direct_wrapper)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>function</i></td><td></td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
<p />
<code>MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method)</code>
<p />
We also catch exceptions if <i>exc</i> is not <code>NULL</code>.
If <i>virtual</i> is <code>TRUE</code>, then <i>method</i> is invoked virtually on <i>this</i>. This is useful since
it means that the compiled code for <i>method</i> does not have to be looked up
before calling the runtime invoke wrapper. In this case, the wrapper ignores
its <i>method</i> argument.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_stelemref"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_stelemref</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_stelemref (void)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_stfld_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_stfld_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_stfld_wrapper (MonoType *type)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>type</i></td><td> the type of the field</td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
<p />
This method generates a function which can be use to store a field with type
<i>type</i>. The generated function has the following signature:
<p />
<code>void stfld_wrapper (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, int offset, <i>type</i> val)</code></div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_struct_to_ptr"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_struct_to_ptr</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_struct_to_ptr (MonoClass *klass)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>klass</i></td><td> <code>MonoClass</code></td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
<p />
Generates IL code for <code>StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld)</code></div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_synchronized_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_synchronized_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_synchronized_wrapper (MonoMethod *method)
</div>
<p />
<div class="mapi-section">Parameters</div>
<table class="mapi-parameters"><tbody><tr><td><i>wrapper</i></td><td> the generated method</td></tr></tbody></table> <div class="mapi-section">Description</div>
<div>
calls <i>method</i> while locking <code>this</code> or the parent type.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_unbox_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_unbox_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_unbox_wrapper (MonoMethod *method)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
The returned method calls <i>method</i> unboxing the <code>this</code> argument.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_get_xappdomain_invoke"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_get_xappdomain_invoke</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_get_xappdomain_invoke (MonoMethod *method, MonoError *error)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
Generates a fast remoting wrapper for cross app domain calls.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_load_type_info"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_load_type_info</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMarshalType*
mono_marshal_load_type_info (MonoClass* klass)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
<p />
Initialize <code>klass::marshal_info</code> using information from metadata. This function can
recursively call itself, and the caller is responsible to avoid that by calling
<code>mono_marshal_is_loading_type_info</code> beforehand.
<p />
LOCKING: Acquires the loader lock.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_method_from_wrapper"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_method_from_wrapper</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoMethod*
mono_marshal_method_from_wrapper (MonoMethod *wrapper)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_set_last_error"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_set_last_error</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_marshal_set_last_error (void)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
<p />
This function is invoked to set the last error value from a P/Invoke call
which has <code>SetLastError</code> set.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_marshal_type_size"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_marshal_type_size</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">gint32
mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align,
gboolean as_field, gboolean unicode)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
<h2>Metadata Loader Locking: Internals</h2>
<p />The locking functions here are used by code in class.c and
metadata.c to lock access to the shared hashtables inside the
MonoImage.
</div> <!-- class=mapi -->
<a name="api:mono_loader_lock"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_loader_lock</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_loader_lock (void)
</div>
<p />
<div class="mapi-section">Description</div>
<div>
<p />
See <code>docs/thread-safety.txt</code> for the locking strategy.</div>
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_loader_unlock"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_loader_unlock</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_loader_unlock (void)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
<h2>Garbage Collector Internal Interface</h2>
<p />The internal interface of the Mono GC is the interface used
between the runtime engine and the garbage collector.
</div> <!-- class=mapi -->
<a name="api:mono_gc_alloc_fixed"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_alloc_fixed</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoObject*
mono_gc_alloc_fixed (size_t size, MonoGCDescriptor descr, MonoGCRootSource source, void *key, const char *msg)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_gc_free_fixed"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_free_fixed</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_gc_free_fixed (void* addr)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_gc_make_descr_from_bitmap"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_make_descr_from_bitmap</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">SgenDescriptor
mono_gc_make_descr_from_bitmap (gsize *bitmap, int numbits)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_gc_base_init"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_base_init</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">void
mono_gc_base_init (void)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_gc_invoke_finalizers"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_invoke_finalizers</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">int
mono_gc_invoke_finalizers (void)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_gc_is_gc_thread"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_is_gc_thread</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">gboolean
mono_gc_is_gc_thread (void)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_gc_pending_finalizers"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_pending_finalizers</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">MonoBoolean
mono_gc_pending_finalizers (void)
</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->
</div> <!-- class=mapi -->
<a name="api:mono_gc_register_thread"></a>
<div class="mapi">
<div class="mapi-entry "><code>mono_gc_register_thread</code></div>
<div class="mapi-height-container">
<div class="mapi-ptr-container"></div>
<div class="mapi-description">
<div class="mapi-ptr"></div>
<div class="mapi-declaration mapi-section">Syntax</div>
<div class="mapi-prototype">mono_gc_register_thread</div>
<p />
</div><!--mapi-description -->
</div><!--height container -->