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:
parent
1602bd5d29
commit
a33547d8ad
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user