1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-04 09:18:36 +03:00

Un-inline dbg_strdup.

This commit is contained in:
Alasdair Kergon 2005-05-09 17:01:06 +00:00
parent 32469fb25c
commit 4d12267641
3 changed files with 14 additions and 11 deletions

View File

@ -1,5 +1,6 @@
Version 2.01.11 - Version 2.01.11 -
============================== ==============================
Un-inline dbg_strdup.
lv_reduce tidying. lv_reduce tidying.
Remove some unnecessary parameters. Remove some unnecessary parameters.
Introduce seg_is macros. Introduce seg_is macros.

View File

@ -19,6 +19,16 @@
#include <stdarg.h> #include <stdarg.h>
char *dbg_strdup(const char *str)
{
char *ret = dbg_malloc(strlen(str) + 1);
if (ret)
strcpy(ret, str);
return ret;
}
#ifdef DEBUG_MEM #ifdef DEBUG_MEM
struct memblock { struct memblock {

View File

@ -21,7 +21,9 @@
#include <string.h> #include <string.h>
void *malloc_aux(size_t s, const char *file, int line); void *malloc_aux(size_t s, const char *file, int line);
# define dbg_malloc(s) malloc_aux((s), __FILE__, __LINE__) #define dbg_malloc(s) malloc_aux((s), __FILE__, __LINE__)
char *dbg_strdup(const char *str);
#ifdef DEBUG_MEM #ifdef DEBUG_MEM
@ -42,14 +44,4 @@ void bounds_check(void);
#endif #endif
static inline char *dbg_strdup(const char *str)
{
char *ret = dbg_malloc(strlen(str) + 1);
if (ret)
strcpy(ret, str);
return ret;
}
#endif #endif