From 9addeea6f35a7f1b1c20d818dd022ed64086a6a2 Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 19 Aug 2009 09:49:19 +0100 Subject: renamed and restyled exit info printer --- src/corelib/arch/symbian/qatomic_symbian.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp index b08a468..e418c09 100644 --- a/src/corelib/arch/symbian/qatomic_symbian.cpp +++ b/src/corelib/arch/symbian/qatomic_symbian.cpp @@ -44,33 +44,40 @@ #include -// Heap and handle info printer. This code is placed here as it happens to make it the very last static to be destroyed in a Qt app. +QT_BEGIN_NAMESPACE + +// Heap and handle info printer. // This way we can report on heap cells and handles that are really not owned by anything which still exists. // This information can be used to detect whether memory leaks are happening, particularly if these numbers grow as the app is used more. -struct SPrintExitInfo +// This code is placed here as it happens to make it the very last static to be destroyed in a Qt app. The +// reason assumed is that this file appears before any other file declaring static data in the generated +// Symbian MMP file. This particular file was chosen as it is the earliest symbian specific file. +struct QSymbianPrintExitInfo { - SPrintExitInfo() + QSymbianPrintExitInfo() { - RThread().HandleCount(initProcessHandleCount,initThreadHandleCount); + RThread().HandleCount(initProcessHandleCount, initThreadHandleCount); initCells = User::CountAllocCells(); } - ~SPrintExitInfo() + ~QSymbianPrintExitInfo() { RProcess myProc; TFullName fullName = myProc.FileName(); TInt cells = User::CountAllocCells(); TInt processHandleCount=0; TInt threadHandleCount=0; - RThread().HandleCount(processHandleCount,threadHandleCount); + RThread().HandleCount(processHandleCount, threadHandleCount); RDebug::Print(_L("%S exiting with %d allocated cells, %d handles"), - &fullName, - cells - initCells, - (processHandleCount + threadHandleCount) - (initProcessHandleCount + initThreadHandleCount)); + &fullName, + cells - initCells, + (processHandleCount + threadHandleCount) - (initProcessHandleCount + initThreadHandleCount)); } TInt initCells; TInt initProcessHandleCount; TInt initThreadHandleCount; -} printExitInfo; +} symbian_printExitInfo; + +QT_END_NAMESPACE #if defined(Q_CC_RVCT) -- cgit v0.12