//#define IMAP_MALLOC 1 chrisp playing, don't use THESE ALSO EXIST IN IMAP.C AND MUST MATCH!!!
//##define IMAP_MALLOC 1 //chrisp playing, don't use

// Testing again...
#ifndef done_mymalloc
#define done_mymalloc 1

#define IMAP_MALLOC 1


#ifdef IMAP_MALLOC
#undef malloc
#undef calloc
#undef realloc
#undef free
#undef strdup

#define malloc DIEDIE
#define calloc DIEDIE2
#define realloc DIEDIEREALLOC
#define free DIEDIEFREE
#define strdup DIESTRDUP_use_mystrdup1
//#	define myrealloc			simple_realloc
//#	define mycalloc				simple_calloc
//#	define mymalloc(size)		simple_malloc(size)

#	define myrealloc(a,b)			simple_realloc(a,b,__FILE__,__LINE__)
#	define mycalloc(a,b)			simple_calloc(a,b,__FILE__,__LINE__)
#	define mymalloc(size)		simple_malloc(size,__FILE__,__LINE__)


#	define myfree(ptr)			{if (ptr) { simple_free(ptr,__FILE__,__LINE__); ptr = NULL; }}
#	define mystrdup(des,src)	{ if (src) { des = (char *)simple_malloc((int)strlen(src)+1,__FILE__,__LINE__); if (des) strcpy(des,src); } else des = NULL; }
#	define mystrdup1(a)	simple_strdup(a,__FILE__,__LINE__)
#	define mystrdup3(des,src)	{ if (src) { des = (char *)simple_malloc((int)strlen(src)+1,__FILE__,__LINE__); if (des) strcpy(des,src); } else des = NULL; }

#else

#	define mystrdup1			strdup
#	define myrealloc			realloc
#	define mycalloc				calloc
#	define mymalloc(size)		malloc(size)
#	define myfree(ptr)			{if (ptr) { free(ptr); ptr = NULL; }}
#	define mystrdup(des,src)	{ if (src) { des = (char *)mymalloc(strlen(src)+1); if (des) strcpy(des,src); } else des = NULL; }
#	define mystrdup3(des,src)	{ if (src) { des = (char *)d_malloc(strlen(src)+1,__FILE__,srcline); if (des) strcpy(des,src); } else des = NULL; }
#endif



#endif
