diff options
Diffstat (limited to 'include/my_sys.h')
-rw-r--r-- | include/my_sys.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index 6ab6a41ed44..742f1c0b61e 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -210,7 +210,7 @@ extern void my_large_free(uchar * ptr, myf my_flags); #define my_alloca(SZ) alloca((size_t) (SZ)) #define my_afree(PTR) {} #else -#define my_alloca(SZ) my_malloc(SZ,MYF(0)) +#define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE)) #define my_afree(PTR) my_free(PTR,MYF(MY_WME)) #endif /* HAVE_ALLOCA */ @@ -870,6 +870,10 @@ extern void set_prealloc_root(MEM_ROOT *root, char *ptr); extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, size_t prealloc_size); extern char *strdup_root(MEM_ROOT *root,const char *str); +static inline char *safe_strdup_root(MEM_ROOT *root, const char *str) +{ + return str ? strdup_root(root, str) : 0; +} extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len); extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len); extern int get_defaults_options(int argc, char **argv, |