本文整理汇总了C++中BloatEntry::Ctor方法的典型用法代码示例。如果您正苦于以下问题:C++ BloatEntry::Ctor方法的具体用法?C++ BloatEntry::Ctor怎么用?C++ BloatEntry::Ctor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BloatEntry
的用法示例。
在下文中一共展示了BloatEntry::Ctor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitTraceLog
NS_LogCtor(void* aPtr, const char* aType, uint32_t aInstanceSize)
{
#ifdef NS_IMPL_REFCNT_LOGGING
ASSERT_ACTIVITY_IS_LEGAL;
if (!gInitialized)
InitTraceLog();
if (gLogging) {
LOCK_TRACELOG();
if (gBloatLog) {
BloatEntry* entry = GetBloatEntry(aType, aInstanceSize);
if (entry) {
entry->Ctor();
}
}
bool loggingThisType = (!gTypesToLog || LogThisType(aType));
intptr_t serialno = 0;
if (gSerialNumbers && loggingThisType) {
serialno = GetSerialNumber(aPtr, true);
}
bool loggingThisObject = (!gObjectsToLog || LogThisObj(serialno));
if (gAllocLog && loggingThisType && loggingThisObject) {
fprintf(gAllocLog, "\n<%s> 0x%08X %ld Ctor (%d)\n",
aType, NS_PTR_TO_INT32(aPtr), serialno, aInstanceSize);
nsTraceRefcntImpl::WalkTheStack(gAllocLog);
}
UNLOCK_TRACELOG();
}
#endif
}
示例2: InitTraceLog
NS_LogAddRef(void* aPtr, nsrefcnt aRefcnt,
const char* aClass, uint32_t aClassSize)
{
#ifdef NS_IMPL_REFCNT_LOGGING
ASSERT_ACTIVITY_IS_LEGAL;
if (!gInitialized) {
InitTraceLog();
}
if (gLogging == NoLogging) {
return;
}
if (aRefcnt == 1 || gLogging == FullLogging) {
LOCK_TRACELOG();
if (aRefcnt == 1 && gBloatLog) {
BloatEntry* entry = GetBloatEntry(aClass, aClassSize);
if (entry) {
entry->Ctor();
}
}
// Here's the case where MOZ_COUNT_CTOR was not used,
// yet we still want to see creation information:
bool loggingThisType = (!gTypesToLog || LogThisType(aClass));
intptr_t serialno = 0;
if (gSerialNumbers && loggingThisType) {
serialno = GetSerialNumber(aPtr, aRefcnt == 1);
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 (aRefcnt == 1 && gAllocLog && loggingThisType && loggingThisObject) {
fprintf(gAllocLog, "\n<%s> %p %" PRIdPTR " Create\n", aClass, aPtr, serialno);
nsTraceRefcnt::WalkTheStackCached(gAllocLog);
}
if (gRefcntsLog && loggingThisType && loggingThisObject) {
// Can't use PR_LOG(), b/c it truncates the line
fprintf(gRefcntsLog, "\n<%s> %p %" PRIuPTR " AddRef %" PRIuPTR "\n",
aClass, aPtr, serialno, aRefcnt);
nsTraceRefcnt::WalkTheStackCached(gRefcntsLog);
fflush(gRefcntsLog);
}
UNLOCK_TRACELOG();
}
#endif
}