00001 /*************************************************************************** 00002 tjheap.h - description 00003 ------------------- 00004 begin : Thu Jul 31 2003 00005 copyright : (C) 2001 by Thies H. Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef TJHEAP_H 00019 #define TJHEAP_H 00020 00021 #ifndef TJUTILS_CONFIG_H 00022 #define TJUTILS_CONFIG_H 00023 #include <tjutils/config.h> 00024 #endif 00025 00026 // pointer for external trace function 00027 typedef void (*heaptracefunction)(const char*); 00028 00029 00030 class Heap { 00031 public: 00032 static void malloc_stats(); 00033 static void set_trace_function(heaptracefunction func) {tracefunc=func;} 00034 00035 static heaptracefunction tracefunc; 00036 }; 00037 00038 00039 //#ifdef CUSTOM_HEAP 00040 00041 //#include <tjutils/tjcstd.h> 00042 00043 //#ifndef STL_REPLACEMENT 00044 //#include <new> 00045 //#endif 00046 00047 00048 // overloading new/delete if a custom heap (block of static memory) is used 00049 00050 //#ifndef STL_REPLACEMENT 00051 //void* operator new(size_t size) throw (std::bad_alloc); 00052 //#else 00053 //void* operator new(size_t size); 00054 //#endif 00055 //void* operator new[](size_t size); 00056 00057 //void operator delete(void* mptr); 00058 //void operator delete[](void* mptr); 00059 00060 //#endif 00061 00062 00063 #endif
1.5.6