version 1.8, 2000/09/06 09:44:24
|
version 1.9, 2000/12/10 17:10:38
|
Line 8
|
Line 8
|
#ifndef _RPM2HTML_DEBUG_MEMORY_ALLOC_ |
#ifndef _RPM2HTML_DEBUG_MEMORY_ALLOC_ |
#define _RPM2HTML_DEBUG_MEMORY_ALLOC_ |
#define _RPM2HTML_DEBUG_MEMORY_ALLOC_ |
|
|
#define NO_DEBUG_MEMORY |
/* #define NO_DEBUG_MEMORY */ |
|
#include <libxml/xmlmemory.h> |
#ifdef __INSIGHT__ |
#include <libxml/parser.h> |
#define NO_DEBUG_MEMORY |
|
#endif |
|
|
|
#ifdef NO_DEBUG_MEMORY |
|
#include <malloc.h> |
|
|
|
#define debugFree(x) free((x)) |
|
#define debugMalloc(x) malloc(x) |
|
#define debugRealloc(p, x) realloc((p), (x)) |
|
#define debugStrdup(x) strdup((x)) |
|
#define debugInitMemory() |
|
#define debugMemUsed() |
|
#define debugInitMemory() |
|
#define debugMemoryDump() |
|
#define debugMemDisplay(x) |
|
|
|
#else /* ! NO_DEBUG_MEMORY */ |
|
#include <stdio.h> |
|
|
|
/* #define DEBUG_MEMORY */ /* */ |
|
|
|
#define DEBUG_MEMORY_LOCATION |
|
|
|
#ifdef DEBUG |
|
#ifndef DEBUG_MEMORY |
|
#define DEBUG_MEMORY |
|
#endif |
|
#endif |
|
|
|
#define MEM_LIST /* keep a list of all the allocated memory blocks */ |
|
|
|
/* initialization functions */ |
|
extern int debugInitMemory(void); |
|
extern void * debugMalloc(int size); |
|
extern void * debugRealloc(void *ptr,int size); |
|
extern int debugFree(void *ptr); |
|
extern char * debugStrdup(const char *str); |
|
extern int debugMemUsed(void); |
|
extern void debugMemDisplay(FILE *fp); |
|
extern int debugInitMemory(void); |
|
|
|
#ifdef DEBUG_MEMORY_LOCATION |
|
#define debugMalloc(x) debugMallocLoc((x), __FILE__, __LINE__) |
|
#define debugRealloc(p, x) debugReallocLoc((p), (x), __FILE__, __LINE__) |
|
#define debugStrdup(x) debugStrdupLoc((x), __FILE__, __LINE__) |
|
|
|
extern void * debugMallocLoc(int size, const char *file, int line); |
|
extern void * debugReallocLoc(void *ptr,int size, const char *file, int line); |
|
extern char * debugStrdupLoc(const char *str, const char *file, int line); |
|
#endif /* DEBUG_MEMORY_LOCATION */ |
|
#endif /* ! NO_DEBUG_MEMORY */ |
|
|
|
#endif /* _RPM2HTML_DEBUG_MEMORY_ALLOC_ */ |
#endif /* _RPM2HTML_DEBUG_MEMORY_ALLOC_ */ |
|
|