00001 #ifndef HEPHAESTUS_MEMORYTRACE_H 00002 #define HEPHAESTUS_MEMORYTRACE_H 00003 00004 /* 00005 Holder for memory trace information 00006 */ 00007 00008 #ifdef __cplusplus 00009 extern "C" { 00010 #endif 00011 00012 struct hhh_MemoryTrace { 00013 long size; 00014 void *trace[ hhh_BACKTRACE_SIZE ]; 00015 }; 00016 00017 /* initialize a newly created MemoryTrace */ 00018 void hhh_MemoryTrace_initialize( struct hhh_MemoryTrace *mt, long size ); 00019 00020 /* get the type that was newed, if available */ 00021 const char* hhh_MemoryTrace_getType( struct hhh_MemoryTrace *mt ); 00022 00023 /* report on traceback */ 00024 void hhh_MemoryTrace_print( FILE*, struct hhh_MemoryTrace *mt, int hideMemAddr ); 00025 00026 /* comparison function, returns like strcmp */ 00027 int hhh_MemoryTracePtr_compare( const void *pmt1, const void *pmt2 ); 00028 00029 #ifdef __cplusplus 00030 } /* extern "C" */ 00031 #endif 00032 00033 /* clarifying access to memory trace members */ 00034 #define hhh_MT_ORIGINATOR( b ) (b).trace[0] 00035 00036 #endif /* !HEPHAESTUS_MEMORYTRACE_H */