2007-04-08 10:36:36 +00:00
|
|
|
/**************************************************************************
|
2007-09-26 19:40:22 +00:00
|
|
|
* File: zmalloc.h Part of tbaMUD *
|
|
|
|
|
* Usage: A simple memory allocation monitor, header. *
|
|
|
|
|
* *
|
|
|
|
|
* Version 1.1 Copyright 1996, 1998, 1999, 2000 Eric Murray ericm@lne.com *
|
2007-04-08 10:36:36 +00:00
|
|
|
**************************************************************************/
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
|
|
|
#ifndef ZMALLOC_H
|
|
|
|
|
#define ZMALLOC_H
|
|
|
|
|
|
2007-09-13 15:00:59 +00:00
|
|
|
unsigned char *zmalloc(int, char *, int);
|
|
|
|
|
unsigned char *zrealloc(unsigned char *, int, char *, int);
|
|
|
|
|
void zfree(unsigned char *, char *, int);
|
|
|
|
|
void zmalloc_init(void);
|
|
|
|
|
void zmalloc_check(void);
|
|
|
|
|
char *zstrdup(const char *, char *, int);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
2007-09-13 15:00:59 +00:00
|
|
|
#define malloc(x) zmalloc((x),__FILE__,__LINE__)
|
|
|
|
|
#define calloc(n,x) zmalloc((n*x),__FILE__,__LINE__)
|
|
|
|
|
#define realloc(r,x) zrealloc((unsigned char *)(r),(x),__FILE__,__LINE__)
|
|
|
|
|
#define free(x) zfree((unsigned char *)(x),__FILE__,__LINE__)
|
|
|
|
|
#undef strdup
|
|
|
|
|
#define strdup(x) zstrdup((x), __FILE__, __LINE__)
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
|
|
|
#endif /* ZMALLOC_H */
|