diff --git a/WHATS_NEW b/WHATS_NEW index 21de8352e..0ee99d946 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.01.11 - ============================== + Un-inline dbg_strdup. lv_reduce tidying. Remove some unnecessary parameters. Introduce seg_is macros. diff --git a/lib/mm/dbg_malloc.c b/lib/mm/dbg_malloc.c index 17f500777..1328c1c21 100644 --- a/lib/mm/dbg_malloc.c +++ b/lib/mm/dbg_malloc.c @@ -19,6 +19,16 @@ #include +char *dbg_strdup(const char *str) +{ + char *ret = dbg_malloc(strlen(str) + 1); + + if (ret) + strcpy(ret, str); + + return ret; +} + #ifdef DEBUG_MEM struct memblock { diff --git a/lib/mm/dbg_malloc.h b/lib/mm/dbg_malloc.h index 4d19672f3..d1a743040 100644 --- a/lib/mm/dbg_malloc.h +++ b/lib/mm/dbg_malloc.h @@ -21,7 +21,9 @@ #include 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 @@ -42,14 +44,4 @@ void bounds_check(void); #endif -static inline char *dbg_strdup(const char *str) -{ - char *ret = dbg_malloc(strlen(str) + 1); - - if (ret) - strcpy(ret, str); - - return ret; -} - #endif