20 #ifndef __MEMTRACK_INC__
21 #define __MEMTRACK_INC__
28 #include <libbbb/libbbb.h>
41 # include <QStringList>
44 # define STR_HELPER(a) #a
48 # define STRINGIFY(a) STR_HELPER(a)
55 # define BBM_TRACK(n) public: \
56 QString BB_MEMTRACK_name ( void ) const \
57 { return STRINGIFY(n); } \
104 QList<MemTrack*> allocated_;
110 QList<MemTrack*> freed_;
158 static void wasAllocated (
MemTrack * inst );
164 static void wasFreed (
MemTrack * inst );
170 static bool isAllocated (
MemTrack * inst );
176 static bool isFreed (
MemTrack * inst );
182 static void getAllocated ( QStringList & sl );
188 static void getFreed ( QStringList & sl );
194 static void toString ( QStringList & sl );
200 static void dump (
void );
206 static void dumpAllocated (
void );
212 static int allocatedCount (
void )
213 {
return uniq()->allocated_.count(); }
219 static int freedCount (
void )
220 {
return uniq()->freed_.count(); }
226 static void reinit (
void )
227 { uniq()->freed_.clear(); }
230 #endif // BB_MEMTRACK
304 virtual QString BB_MEMTRACK_name (
void )
const = 0;
316 #endif // BB_MEMTRACK
331 #endif // __MEMTRACK_INC__