[runtime] Implement interior handles as a special case to simplify and speed up the...
[mono-project.git] / mcs / class / corlib / Mono / RuntimeStructs.cs
blob92884a2591d87096214b2498460e1c9499351f3a
1 //
2 // Mono runtime native structs surfaced to managed code.
3 //
4 // Authors:
5 // Aleksey Kliger <aleksey@xamarin.com>
6 // Rodrigo Kumpera <kumpera@xamarin.com>
7 //
8 // Copyright 2016 Dot net foundation.
9 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
12 using System;
13 using System.Runtime.InteropServices;
15 #pragma warning disable 169
17 namespace Mono {
19 // Managed representations of mono runtime types
21 internal static class RuntimeStructs {
22 // class-internals.h MonoRemoteClass
23 [StructLayout(LayoutKind.Sequential)]
24 internal unsafe struct RemoteClass {
25 internal IntPtr default_vtable;
26 internal IntPtr xdomain_vtable;
27 internal MonoClass* proxy_class;
28 internal IntPtr proxy_class_name;
29 internal uint interface_count;
30 // FIXME: How to represent variable-length array struct member?
31 // MonoClass* interfaces [];
34 internal struct MonoClass {
37 // class-internals.h MonoGenericParamInfo
38 internal unsafe struct GenericParamInfo {
39 internal MonoClass* pklass;
40 internal IntPtr name;
41 internal ushort flags;
42 internal uint token;
43 internal MonoClass** constraints; /* NULL terminated */
46 // glib.h GPtrArray
47 internal unsafe struct GPtrArray {
48 internal IntPtr* data;
49 internal int len;
52 // handle.h HandleStackMark
53 struct HandleStackMark {
54 int size, interior_size;
55 IntPtr chunk;
58 // mono-error.h MonoError
59 struct MonoError {
60 ushort error_code;
61 ushort hidden_0;
62 IntPtr hidden_1, hidden_2, hidden_3, hidden_4, hidden_5, hidden_6, hidden_7, hidden_8;
63 IntPtr hidden_11, hidden_12, hidden_13, hidden_14, hidden_15, hidden_16, hidden_17, hidden_18;
67 //Maps to metadata-internals.h:: MonoAssemblyName
68 internal unsafe struct MonoAssemblyName
70 const int MONO_PUBLIC_KEY_TOKEN_LENGTH = 17;
72 internal IntPtr name;
73 internal IntPtr culture;
74 internal IntPtr hash_value;
75 internal IntPtr public_key;
76 internal fixed byte public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
77 internal uint hash_alg;
78 internal uint hash_len;
79 internal uint flags;
80 internal ushort major, minor, build, revision;
81 internal ushort arch;