tmgdmalloc.h.fancy

来自「基于chord算法的p2p文件系统。A p2p file system base」· FANCY 代码 · 共 57 行

FANCY
57
字号
#ifndef __TMG_DMALLOC_H#define __TMG_DMALLOC_H//// Usage://// ./configure --with-tmgdmalloc// #include "tmgdmalloc.h"//// Then use New rather than new.//// __tmg_dmalloc_stats will tell you the location of un-delete-d objects.//#include "config.h"#ifdef HAVE_EXT_HASH_MAP# include <ext/hash_map>using namespace __gnu_cxx;namespace __gnu_cxx {#else# include <hash_map>using namespace std;namespace std {#endif  template<> struct hash<void*> {    size_t operator()(void *x) const {      return (size_t) x;    }  };}void __tmg_dmalloc_new(void *, size_t, const char*, unsigned);void __tmg_dmalloc_del(void *);void __tmg_dmalloc_stats();void __tmg_dmalloc_info(void *p);// if WITH_TMGDMALLOC, then new and delete will go through tmgdmalloc and will// not be cached.//// otherwise it will use the ones in cache.Cvoid  operator delete(void *p);void  operator delete[](void *p);#ifdef WITH_TMGDMALLOCvoid* operator new(size_t, const char*, unsigned);void* operator new[](size_t, const char*, unsigned);# define New new(__FILE__, __LINE__)#elsevoid* operator new(size_t);void* operator new[](size_t);# define New new#endif // WITH_TMGDMALLOC#endif //  __TMG_DMALLOC_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?