本文整理汇总了C++中BloatEntry::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ BloatEntry::Release方法的具体用法?C++ BloatEntry::Release怎么用?C++ BloatEntry::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BloatEntry
的用法示例。
在下文中一共展示了BloatEntry::Release方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitTraceLog
NS_LogRelease(void* aPtr, nsrefcnt aRefcnt, const char* aClazz)
{
#ifdef NS_IMPL_REFCNT_LOGGING
ASSERT_ACTIVITY_IS_LEGAL;
if (!gInitialized)
InitTraceLog();
if (gLogging) {
LOCK_TRACELOG();
if (gBloatLog) {
BloatEntry* entry = GetBloatEntry(aClazz, 0);
if (entry) {
entry->Release(aRefcnt);
}
}
bool loggingThisType = (!gTypesToLog || LogThisType(aClazz));
intptr_t serialno = 0;
if (gSerialNumbers && loggingThisType) {
serialno = GetSerialNumber(aPtr, false);
NS_ASSERTION(serialno != 0,
"Serial number requested for unrecognized pointer! "
"Are you memmoving a refcounted object?");
int32_t* count = GetRefCount(aPtr);
if(count)
(*count)--;
}
bool loggingThisObject = (!gObjectsToLog || LogThisObj(serialno));
if (gRefcntsLog && loggingThisType && loggingThisObject) {
if (gLogToLeaky) {
(*leakyLogRelease)(aPtr, aRefcnt + 1, aRefcnt);
}
else {
// Can't use PR_LOG(), b/c it truncates the line
fprintf(gRefcntsLog,
"\n<%s> 0x%08X %ld Release %d\n", aClazz, NS_PTR_TO_INT32(aPtr), serialno, aRefcnt);
nsTraceRefcntImpl::WalkTheStack(gRefcntsLog);
fflush(gRefcntsLog);
}
}
// Here's the case where MOZ_COUNT_DTOR was not used,
// yet we still want to see deletion information:
if (aRefcnt == 0 && gAllocLog && loggingThisType && loggingThisObject) {
fprintf(gAllocLog,
"\n<%s> 0x%08X %ld Destroy\n",
aClazz, NS_PTR_TO_INT32(aPtr), serialno);
nsTraceRefcntImpl::WalkTheStack(gAllocLog);
}
if (aRefcnt == 0 && gSerialNumbers && loggingThisType) {
RecycleSerialNumberPtr(aPtr);
}
UNLOCK_TRACELOG();
}
#endif
}