

                      DMDBG - dynamic memory debug library
                      ====================================

     Files: Library: DMDBG.C DMDBG.H DMDBG.TXT
          : Example: GTEST.C GTEST.TOS

     Many harder to find  program  bugs  are  often associated with dynamic
     memory allocation.  Such  bugs  might  cause  random  crashes,  malloc
     failures, or programs may appear to  work perfectly until run on other
     systems.

     DMDBG is a set of routines  based  on  ideas  by Allen I. Holub in his
     book 'C+C++ Programming with Objects in  C and C++' (an excellent book
     BTW),  designed  to  minimise   dynamic  memory  allocation  problems;
     malloc() and free()  are  called  indirectly  through wrapper routines
     which can check and alert programmers  to problems with dynamic memory
     pointers.

     To make the  routines  more  flexible,  I  have  added  callback error
     handling and pointer checking,  allowing  programmers to install their
     own routines (see example source code).

     There are trade-offs in using dmdbg;  programs  making a lot of malloc
     calls will slow considerably,  and  memory requirements will increase.
     These  routines  should  therefore  be  seen  as  an  aid  to  program
     development, and removed when the  final  executable  is built. To use
     the debugging routines, DMDBG  must  be  #define'd  before you include
     "dmdbg.h". If DMDBG is not  defined,  normal  malloc  and free will be
     used.

     I have not had time to  provide  a formal description of each routine,
     however the code is commented, and I have included an example program.

     If anyone has comments about  the  code  here,  or more ideas for code
     debugging, I would be very interested  in  hearing them, via Ictari of
     course!

     Richard Evans.
