1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Add memory-leak tracing to intdup.

This commit is contained in:
Miciah Dashiel Butler Masters 2005-12-26 11:22:05 +00:00 committed by Miciah Dashiel Butler Masters
parent 1602bd5d29
commit a33547d8ad

View File

@ -164,10 +164,24 @@ mem_align_alloc__(
/* This is out of place, but there is no better place. */ /* This is out of place, but there is no better place. */
#ifdef DEBUG_MEMLEAK
#define intdup(i) intdup__(__FILE__, __LINE__, i)
#else
#define intdup(i) intdup__(i)
#endif
static inline int * static inline int *
intdup(int i) intdup__(
#ifdef DEBUG_MEMLEAK
unsigned char *file, int line,
#endif
int i)
{ {
#ifdef DEBUG_MEMLEAK
int *p = debug_mem_alloc(file, line, sizeof(*p));
#else
int *p = mem_alloc(sizeof(*p)); int *p = mem_alloc(sizeof(*p));
#endif
if (p) *p = i; if (p) *p = i;