diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/arch/symbian/qatomic_symbian.cpp | 27 |
1 files 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 <e32debug.h> -// 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) |