/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#ifndef ___MEMORY_DEBUG_H___
#define ___MEMORY_DEBUG_H___

/*
#define MEMORY_DEBUG
*/

#define MT_MAX		2000

#ifdef MEMORY_DEBUG

void *	d_alloc(int size,int type);
void *	d_re_alloc(void * ptr,int size);
void * d_calloc(int size,int el,int type);
void d_f_ree(void *);
void change_memtype(void * ptr,int type);

#endif

#ifndef MEMORY_DEBUG

#include	<stdlib.h>


#define d_alloc(size,type)	malloc(size)

/*
void * d_alloc(int size,int type);
*/

#define d_re_alloc(ptr,size)	realloc(ptr,size)
#define d_calloc(size,el,type)	calloc(size,el)
#define d_f_ree(ptr)		free(ptr)
#define change_memtype(ptr,type) (0)

/*
void * _x_malloc(int);
void * _x_realloc(void *,int);
void * _x_calloc(int,int);
void _x_free(void *);

#define d_alloc(size,type)	_x_malloc(size)
#define d_re_alloc(ptr,size)	_x_realloc(ptr,size)
#define d_calloc(size,el,type)	_x_calloc(size,el)
#define d_f_ree(ptr)		_x_free(ptr)
#define change_memtype(ptr,type) (0)
*/

#endif

#endif
