47#define PYRAVE_DEBUG_MODULE(oname) \
48 static PyRaveObjectDebugging _pyravedebug = { \
51 static void _pyravedebug_statistics(void) { \
52 if ((_pyravedebug.created - _pyravedebug.destroyed) != 0) { \
53 fprintf(stderr, "\n------------------------------------------\n"); \
54 fprintf(stderr, "CRITICAL ( Python module: %s ) \n", _pyravedebug.name); \
55 fprintf(stderr, "Created objects: %ld\n", _pyravedebug.created); \
56 fprintf(stderr, "Destroyed objects: %ld\n", _pyravedebug.destroyed); \
57 fprintf(stderr, "Objects lost: %ld\n", (_pyravedebug.created - _pyravedebug.destroyed)); \
58 fprintf(stderr, "\n"); \
65#define PYRAVE_DEBUG_OBJECT_CREATED \
66 _pyravedebug.created++
71#define PYRAVE_DEBUG_OBJECT_DESTROYED \
72 _pyravedebug.destroyed++
77#define PYRAVE_DEBUG_INITIALIZE \
78 if (atexit(_pyravedebug_statistics) != 0) { \
79 fprintf(stderr, "Failed to setup debug statistics for module %s\n", _pyravedebug.name); \
Defines the functions for debugging rave.
Debugger struct to be used in rave python modules.
Definition pyrave_debug.h:33
long destroyed
counts how many times an object has been destroyed
Definition pyrave_debug.h:35
long created
counts how many times an object has been created
Definition pyrave_debug.h:34
const char * name
the name for this object
Definition pyrave_debug.h:36