Most data types have common a representation in both the managed and unmanaged worlds. These types are considered Isomorphic because they do not require conversion when marshaled between the managed and unmanaged world.
Table 1 shows the complete list of isomorphic element types supported by the runtime along with the respective language types used to represent those element types in VB, MC++ and C#.
Isomorphic Types | VB | MC++ | C# |
---|---|---|---|
ELEMENT_TYPE_PTR | N/A | void | N/A |
ELEMENT_TYPE_CHAR | char | char | char |
ELEMENT_TYPE_I1 | N/A | char | sbyte |
ELEMENT_TYPE_UI1 | Byte | unsigned char | byte |
ELEMENT_TYPE_I2 | integer | short | short |
ELEMENT_TYPE_UI2 | N/A | unsigned short | ushort |
ELEMENT_TYPE_I4 | long | int, long | int |
ELEMENT_TYPE_UI4 | N/A | unsigned int, unsigned long | uint |
ELEMENT_TYPE_I8 | long8 | __int64 | long |
ELEMENT_TYPE_U8 | N/A | unsigned __int64 | ulong |
ELEMENT_TYPE_R4 | single | float | Float |
ELEMENT_TYPE_R8 | double | double | Double |
ELEMENT_TYPE_R | N/A | N/A | N/A |
ELEMENT_TYPE_I | N/A | N/A | N/A |
ELEMENT_TYPE_U | N/A | N/A | N/A |
ELEMENT_TYPE_FNPTR | N/A | N/A | N/A |
Table 1. Isomorphic element types and their respective language representation
Some complex types are also isomorphic. For example, single dimensional arrays of isomorphic types are also isomorphic and formatted value types that contain only isomorphic types are also isomorphic.