Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Helpers/MemDebug.hpp

    r992fd7 r6d6b54  
    2828#endif
    2929
    30 #include <cstdlib>
    3130#include <new>
     31
     32// some light header files, that do weird new stuff and therefore need
     33// to be loaded before the define
     34#include <string>
     35#include <boost/shared_ptr.hpp>
     36#include <boost/function.hpp>
     37#include <boost/program_options.hpp>
     38
    3239
    3340namespace Memory {
     
    5360  }
    5461}
    55 
     62#ifdef __GNUC__
     63void *operator new   (size_t nbytes,const char* file, int line, const char* func) throw(std::bad_alloc);
     64void *operator new[] (size_t nbytes,const char* file, int line, const char* func) throw(std::bad_alloc);
     65#else
    5666void *operator new   (size_t nbytes,const char* file, int line) throw(std::bad_alloc);
    5767void *operator new[] (size_t nbytes,const char* file, int line) throw(std::bad_alloc);
     68#endif
    5869void operator delete   (void *ptr,const char*, int) throw();
    5970void operator delete[] (void *ptr,const char*, int) throw();
     71
     72
    6073
    6174/**
     
    6376 * version that allows tracking.
    6477 */
     78#ifdef __GNUC__
     79#define new new(__FILE__,__LINE__,__PRETTY_FUNCTION__)
     80#else
    6581#define new new(__FILE__,__LINE__)
     82#endif
    6683
    6784#endif
    6885#endif
    6986
     87
     88#ifdef NDEBUG
     89#undef MEMDEBUG
     90#endif
    7091
    7192#ifndef MEMDEBUG
Note: See TracChangeset for help on using the changeset viewer.