Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Helpers/MemDebug.hpp

    r6d6b54 r097902  
    2121 * your sourcefiles.
    2222 */
    23 #ifndef NDEBUG
    24 #ifndef NO_MEMDEBUG
    2523
    26 #ifndef MEMDEBUG
    27 #define MEMDEBUG
     24// Set all flags in a way that makes sense
     25
     26// NDEBUG implies NO_MEMDEBUG
     27#ifdef NDEBUG
     28# ifndef NO_MEMDEBUG
     29#   define NO_MEMDEBUG
     30# endif
    2831#endif
     32
     33// NO_MEMDEBUG and MEMDEBUG are mutually exclusive, but at least one must be set
     34#ifdef NO_MEMDEBUG
     35# ifdef MEMDEBUG
     36#   undef MEMDEBUG
     37# endif
     38#else
     39# ifndef MEMDEBUG
     40#   define MEMDEBUG
     41# endif
     42#endif
     43
     44#ifdef MEMDEBUG
    2945
    3046#include <new>
     
    3349// to be loaded before the define
    3450#include <string>
     51#include <boost/optional.hpp>
    3552#include <boost/shared_ptr.hpp>
    3653#include <boost/function.hpp>
     
    4461   */
    4562  void getState();
     63  void dumpMemory(std::ostream&);
    4664
    4765  void _ignore(void*);
     
    82100#endif
    83101
    84 #endif
    85 #endif
    86 
    87 
    88 #ifdef NDEBUG
    89 #undef MEMDEBUG
    90 #endif
    91 
    92 #ifndef MEMDEBUG
     102#else
    93103// memory debugging was disabled
    94104
    95105namespace Memory {
    96106  inline void getState(){}
     107
     108  inline void dumpMemory(std::ostream&){};
    97109
    98110  template <typename T>
     
    103115
    104116#endif
     117
     118
    105119#endif /* MEMDEBUG_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.