📄 tmgdmalloc.h.fancy
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -