diff options
Diffstat (limited to 'mysys/my_once.c')
-rw-r--r-- | mysys/my_once.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysys/my_once.c b/mysys/my_once.c index 1250ce24994..a4201810b03 100644 --- a/mysys/my_once.c +++ b/mysys/my_once.c @@ -23,6 +23,7 @@ #include "mysys_priv.h" #include "my_static.h" #include "mysys_err.h" +#include <m_string.h> /* Alloc for things we don't nead to free @@ -78,6 +79,25 @@ gptr my_once_alloc(unsigned int Size, myf MyFlags) } /* my_once_alloc */ +char *my_once_strdup(const char *src,myf myflags) +{ + uint len=strlen(src)+1; + char *dst=my_once_alloc(len, myflags); + if (dst) + memcpy(dst, src, len); + return dst; +} + + +char *my_once_memdup(const char *src, uint len, myf myflags) +{ + char *dst=my_once_alloc(len, myflags); + if (dst) + memcpy(dst, src, len); + return dst; +} + + /* Deallocate everything used by my_once_alloc |