#ifdef DEBUG//Uniquement en mode debug #ifndef _SURCHARGE_NEW_H_ #define _SURCHARGE_NEW_H_ #include "gestionnaire_memoire.h" inline void* operator new(std::size_t taille, const char* fichier, int ligne) { return GM::GESTIONNAIRE_MEMOIRE::instance().allouer(taille,fichier,ligne,false); } inline void* operator new[](std::size_t taille, const char* fichier, int ligne) { return GM::GESTIONNAIRE_MEMOIRE::instance().allouer(taille,fichier,ligne,true); } inline void operator delete(void* pointeur) throw() { GM::GESTIONNAIRE_MEMOIRE::instance().liberer(pointeur,false); } inline void operator delete[](void* pointeur) throw() { GM::GESTIONNAIRE_MEMOIRE::instance().liberer(pointeur,true); } #ifndef _BORLANDC_ //Borland ne peut pas accepter ce type de surcharge inline void operator delete(void* pointeur, const char* fichier, int ligne) throw() { GM::GESTIONNAIRE_MEMOIRE::instance().desalloc_suivante(fichier, ligne); GM::GESTIONNAIRE_MEMOIRE::instance().liberer(pointeur,false); } inline void operator delete[](void* pointeur, const char* fichier, int ligne) throw() { GM::GESTIONNAIRE_MEMOIRE::instance().desalloc_suivante(fichier, ligne); GM::GESTIONNAIRE_MEMOIRE::instance().liberer(pointeur,true); } #endif //BORLANDC #endif// ifndef classique #ifndef new #define new new(__FILE__, __LINE__) #define delete GM::GESTIONNAIRE_MEMOIRE::instance().desalloc_suivante(__FILE__, __LINE__), delete #endif #endif//DEBUG