本文整理汇总了C++中BloatEntry::Dump方法的典型用法代码示例。如果您正苦于以下问题:C++ BloatEntry::Dump方法的具体用法?C++ BloatEntry::Dump怎么用?C++ BloatEntry::Dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BloatEntry
的用法示例。
在下文中一共展示了BloatEntry::Dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOCK_TRACELOG
nsresult
nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
{
#ifdef NS_IMPL_REFCNT_LOGGING
if (gBloatLog == nullptr || gBloatView == nullptr) {
return NS_ERROR_FAILURE;
}
if (out == nullptr) {
out = gBloatLog;
}
LOCK_TRACELOG();
bool wasLogging = gLogging;
gLogging = false; // turn off logging for this method
BloatEntry total("TOTAL", 0);
PL_HashTableEnumerateEntries(gBloatView, BloatEntry::TotalEntries, &total);
const char* msg;
if (type == NEW_STATS) {
if (gLogLeaksOnly)
msg = "NEW (incremental) LEAK STATISTICS";
else
msg = "NEW (incremental) LEAK AND BLOAT STATISTICS";
}
else {
if (gLogLeaksOnly)
msg = "ALL (cumulative) LEAK STATISTICS";
else
msg = "ALL (cumulative) LEAK AND BLOAT STATISTICS";
}
const bool leaked = total.PrintDumpHeader(out, msg, type);
nsTArray<BloatEntry*> entries;
PL_HashTableEnumerateEntries(gBloatView, BloatEntry::DumpEntry, &entries);
const uint32_t count = entries.Length();
if (!gLogLeaksOnly || leaked) {
// Sort the entries alphabetically by classname.
entries.Sort();
for (uint32_t i = 0; i < count; ++i) {
BloatEntry* entry = entries[i];
entry->Dump(i, out, type);
}
fprintf(out, "\n");
}
fprintf(out, "nsTraceRefcntImpl::DumpStatistics: %d entries\n", count);
if (gSerialNumbers) {
fprintf(out, "\nSerial Numbers of Leaked Objects:\n");
PL_HashTableEnumerateEntries(gSerialNumbers, DumpSerialNumbers, out);
}
gLogging = wasLogging;
UNLOCK_TRACELOG();
#endif
return NS_OK;
}