/*
 * dmalloc.h
 * (C) Christian Magnusson 1999, Email: d1mag@dtek.chalmers.se
 * This program is copyright, and covered by the Gnu Public License.
 * The Q bot.
 */
#ifndef DMALLOC_H
#define DMALLOC_H

#include "settings.h"

#ifdef DMALLOC

#define Malloc(sz) Malloc2((sz), __FUNCTION__, __LINE__)
#define Free(sz)   Free2((sz))

extern int tot_malloc;

typedef struct mb {
  void *ptr;
  unsigned int sz;
  unsigned int line;
#ifdef DMALLOC_SAVEMEM
  char *func;
#else
  char func[25];
#endif
} mb;

typedef struct mbstat {
  unsigned int sz;
  unsigned int nr;
#ifdef DMALLOC_SAVEMEM
  char *func;
#else
  char func[25];
#endif
} mbstat;



#else

#define Malloc(sz) malloc((sz))
#define Free(sz) free((sz))

#endif

#endif

