in SharpGen/Model/CsFundamentalType.cs [17:48]
internal CsFundamentalType(Type type, string name) : base(null, name)
{
var typeInfo = type.GetTypeInfo();
IsPrimitive = typeInfo.IsPrimitive;
IsValueType = typeInfo.IsValueType || IsPrimitive;
IsString = type == typeof(string);
IsIntPtr = type == typeof(IntPtr) || type == typeof(UIntPtr);
if (IsIntPtr)
{
IsUntypedPointer = true;
}
else if (typeInfo.IsPointer)
{
var reducedToPointer = ReducePointers(type, typeInfo);
IsUntypedPointer = reducedToPointer == VoidType;
IsTypedPointer = !IsUntypedPointer;
}
IsIntegerType = type == typeof(int)
|| type == typeof(short)
|| type == typeof(byte)
|| type == typeof(long)
|| type == typeof(uint)
|| type == typeof(ushort)
|| type == typeof(sbyte)
|| type == typeof(ulong);
// We need to ensure that we always return 8 (64-bit) even when running the generator on x64.
Size = IsPointerSize ? 8 : SizeOf(type);
AlignmentCore = IsPointerSize ? null : GetAlignment(type) ?? base.AlignmentCore;
}