3 #include <mono/utils/mono-memory-model.h>
4 #include <mono/metadata/abi-details.h>
8 const char alignment
[MONO_ALIGN_COUNT
];
12 #define DECLARE_ABI_DETAILS(I8, I16, I32, I64, F32, F64, PTR) \
13 const static AbiDetails mono_abi_details = { \
14 { I8, I16, I32, I64, F32, F64, PTR } \
17 #ifdef MONO_CROSS_COMPILE
21 DECLARE_ABI_DETAILS (1, 2, 4, 8, 4, 8, 4)
25 #define DECL_OFFSET(struct,field)
26 #define DECL_OFFSET2(struct,field,offset)
27 #define DECL_ALIGN2(type,size) MONO_ALIGN_value_ ##type = size,
28 #define DECL_SIZE(type)
29 #define DECL_SIZE2(type,size)
32 #include "object-offsets.h"
36 MONO_ALIGN_value_gint8
,
37 MONO_ALIGN_value_gint16
,
38 MONO_ALIGN_value_gint32
,
39 MONO_ALIGN_value_gint64
,
40 MONO_ALIGN_value_float
,
41 MONO_ALIGN_value_double
,
42 MONO_ALIGN_value_gpointer
)
48 #define MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(type) typedef struct { char c; type x; } Mono_Align_Struct_ ##type;
49 #define MONO_CURRENT_ABI_ALIGNOF(type) ((int)G_STRUCT_OFFSET(Mono_Align_Struct_ ##type, x))
51 /* Needed by MONO_CURRENT_ABI_ALIGNOF */
52 MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(gint8
)
53 MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(gint16
)
54 MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(gint32
)
55 MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(gint64
)
56 MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(float)
57 MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(double)
58 MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(gpointer
)
61 MONO_CURRENT_ABI_ALIGNOF (gint8
),
62 MONO_CURRENT_ABI_ALIGNOF (gint16
),
63 MONO_CURRENT_ABI_ALIGNOF (gint32
),
64 MONO_CURRENT_ABI_ALIGNOF (gint64
),
65 MONO_CURRENT_ABI_ALIGNOF (float),
66 MONO_CURRENT_ABI_ALIGNOF (double),
67 MONO_CURRENT_ABI_ALIGNOF (gpointer
))
72 mono_abi_alignment (CoreTypeAlign type
)
74 return mono_abi_details
.alignment
[type
];