uint UpdateSize <T> (StreamWriter output, T[] value) { uint typeSize = TargetProvider.GetTypeSize <T> (); uint fieldSize = typeSize * (uint)value.Length; fieldSize += WriteDataPadding(output, fieldSize, structureByteCount); structureByteCount += fieldSize; return(fieldSize); }
protected uint WriteData(StreamWriter output, string value, string label, bool isGlobal = false) { if (String.IsNullOrEmpty(label)) { throw new ArgumentException("must not be null or empty", nameof(label)); } if (value == null) { value = String.Empty; } WriteSection(output, $".rodata.{label}", hasStrings: true, writable: false); WriteSymbol(output, value, isGlobal ? label : MakeLocalLabel(label), size: (ulong)(value.Length + 1), alignBits: 0, isGlobal: isGlobal, isObject: true, alwaysWriteSize: true); return(TargetProvider.GetTypeSize(value)); }
uint UpdateSize <T> (StreamWriter output, T value) { uint fieldSize; Type t = typeof(T); if (t == typeof(string)) { fieldSize = TargetProvider.GetPointerSize(); } else { fieldSize = TargetProvider.GetTypeSize(value); } fieldSize += WriteDataPadding(output, fieldSize, structureByteCount); structureByteCount += fieldSize; return(fieldSize); }