X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fdmalloc.h;fp=include%2Fdmalloc.h;h=f38af77e1cd498eff7c7cc8102f963751434b095;hb=372a500da226336c7bb4036e980be2587ad5fdeb;hp=0000000000000000000000000000000000000000;hpb=c3a132ce4aea3bb358b185ef58781b4bef8745fc;p=yaz-moved-to-github.git diff --git a/include/dmalloc.h b/include/dmalloc.h new file mode 100644 index 0000000..f38af77 --- /dev/null +++ b/include/dmalloc.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 1994, Index Data I/S + * All rights reserved. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: dmalloc.h,v $ + * Revision 1.1 1995-03-30 09:39:40 quinn + * Moved .h files to include directory + * + * Revision 1.1 1995/03/27 08:35:18 quinn + * Created util library + * Added memory debugging module. Imported options-manager + * + * + */ + +#ifndef DMALLOC_H +#define DMALLOC_H + +#ifdef DEBUG_MALLOC + +#ifdef malloc +#undef malloc +#endif +#ifdef free +#undef free +#endif +#ifdef realloc +#undef realloc +#endif +#define malloc(n) d_malloc(__FILE__, __LINE__, (n)) +#define free(p) d_free(__FILE__, __LINE__, (p)) +#define realloc(p, n) d_realloc(__FILE__, __LINE__, (p), (n)) + +void *d_malloc(char *file, int line, int nbytes); +void d_free(char *file, int line, char *ptr); +void *d_realloc(char *file, int line, char *ptr, int nbytes); + +#endif + +#endif