本文整理汇总了C#中SymbolInfo.CalcTotalPadding方法的典型用法代码示例。如果您正苦于以下问题:C# SymbolInfo.CalcTotalPadding方法的具体用法?C# SymbolInfo.CalcTotalPadding怎么用?C# SymbolInfo.CalcTotalPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolInfo
的用法示例。
在下文中一共展示了SymbolInfo.CalcTotalPadding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateDataTable
void PopulateDataTable(DataTable table, IDiaEnumSymbols symbols)
{
ulong cacheLineSize = GetCacheLineSize();
table.Rows.Clear();
foreach (IDiaSymbol sym in symbols)
{
if (sym.length > 0 && !HasSymbol(sym.name))
{
SymbolInfo info = new SymbolInfo();
info.Set(sym.name, "", sym.length, 0);
info.ProcessChildren(sym);
long totalPadding = info.CalcTotalPadding();
DataRow row = table.NewRow();
string symbolName = sym.name;
row["Symbol"] = symbolName;
row["Size"] = info.m_size;
row["Padding"] = totalPadding;
row["Padding/Size"] = (double)totalPadding / info.m_size;
table.Rows.Add(row);
m_symbols.Add(info.m_name, info);
}
}
}
示例2: dumpSymbolInfo
void dumpSymbolInfo(System.IO.TextWriter tw, SymbolInfo info)
{
tw.WriteLine("Symbol: " + info.m_name);
tw.WriteLine("Size: " + info.m_size.ToString());
tw.WriteLine("Total padding: " + info.CalcTotalPadding().ToString());
tw.WriteLine("Members");
tw.WriteLine("-------");
foreach (SymbolInfo child in info.m_children)
{
if (child.m_padding > 0)
{
long paddingOffset = child.m_offset - child.m_padding;
tw.WriteLine(String.Format("{0,-40} {1,5} {2,5}", "****Padding", paddingOffset, child.m_padding));
}
tw.WriteLine(String.Format("{0,-40} {1,5} {2,5}", child.m_name, child.m_offset, child.m_size));
}
// Final structure padding.
if (info.m_padding > 0)
{
long paddingOffset = (long)info.m_size - info.m_padding;
tw.WriteLine(String.Format("{0,-40} {1,5} {2,5}", "****Padding", paddingOffset, info.m_padding));
}
}