NDEBUG is not set.
Click here to view the definition of the#ifndef ALREADY_INCLUDED_DMM_CLASS_HH #define ALREADY_INCLUDED_DMM_CLASS_HH class Dmm { public: virtual ~Dmm() { } /// ensures VTABLE* is the first element public: #ifdef DMM_ONLINE enum_debug_code debug_code; #endif /* DMM_ONLINE */ Dmm(enum_debug_code debug_code) { (void)debug_code; #ifdef DMM_ONLINE this->debug_code = debug_code; #endif /* DMM_ONLINE */ } /// /// NOTE: disables passing and returning by value /// private: Dmm(const Dmm&); Dmm& operator = (const Dmm&); }; #endif /* ALREADY_INCLUDED_DMM_CLASS_HH */
enum enum_debug_code. Every class that
implements DMM should inherit from the above class like so:
Here is the header file for DMM:class Foo : public Dmm { public: Foo() : Dmm(DCODE_FOO) { } };
dmm.hh Here is the footer
file for DMM: dmm.cc Here is a sample main function:
When you run this program, it will print a list of all unfreed memory for debugging purposes.#include "../../2003/noio/io.hh" #include "foo.hh" int main() { #ifdef ALLEGRO_ONLINE allegro_init(); #endif /* ALLEGRO_ONLINE */ cout << "**** BEGIN t-dmm.exe\n"; Foo* f = new Foo(); (void)f; #ifdef DMM_ONLINE dmm_debug_print(); #endif /* DMM_ONLINE */ cout << "**** END t-dmm.exe\n"; return EXIT_SUCCESS; } #ifdef ALLEGRO_ONLINE END_OF_MAIN(); #endif /* ALLEGRO_ONLINE */
| Back to Research Projects |