2
* Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH.
5
* See file LICENSE at the top of this source tree for license information.
12
#include <sys/types.h>
17
void *_dbg_malloc(size_t size, struct lib_context *lc,
18
const char *who, unsigned int line);
19
void *_dbg_realloc(void *ptr, size_t size, struct lib_context *lc,
20
const char *who, unsigned int line);
21
void *_dbg_strdup(void *ptr, struct lib_context *lc,
22
const char *who, unsigned int line);
23
void *_dbg_strndup(void *ptr, size_t len, struct lib_context *lc,
24
const char *who, unsigned int line);
25
void _dbg_free(void *ptr, struct lib_context *lc,
26
const char *who, unsigned int line);
28
#define dbg_malloc(size) _dbg_malloc((size), lc, __func__, __LINE__)
29
#define dbg_realloc(ptr, size) _dbg_realloc((ptr), (size), lc, \
31
#define dbg_strdup(ptr) _dbg_strdup((ptr), lc, __func__, __LINE__)
32
#define dbg_strndup(ptr, len) _dbg_strdup((ptr), len, lc, __func__, __LINE__)
33
#define dbg_free(ptr) _dbg_free((ptr), lc, __func__, __LINE__)
37
void *_dbg_malloc(size_t size);
38
void *_dbg_realloc(void *ptr, size_t size);
39
void *_dbg_strdup(void *ptr);
40
void *_dbg_strndup(void *ptr, size_t len);
41
void _dbg_free(void *ptr);
43
#define dbg_malloc _dbg_malloc
44
#define dbg_realloc _dbg_realloc
45
#define dbg_strdup _dbg_strdup
46
#define dbg_strndup _dbg_strndup
47
#define dbg_free _dbg_free
49
#endif /* #ifdef DEBUG_MALLOC */