diff options
author | unknown <monty@mashka.mysql.fi> | 2003-01-07 23:32:25 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-01-07 23:32:25 +0200 |
commit | 7ffc2004a810ccd497c7adac5e92673fd9cd11d5 (patch) | |
tree | e41e13c5d6b531b1aa1aebafed87402c3ee27438 /mysys/my_once.c | |
parent | c49ef18b0cc01d91e835003f87d9a9a95527cedd (diff) | |
download | mariadb-git-7ffc2004a810ccd497c7adac5e92673fd9cd11d5.tar.gz |
Enchanced my_once..() functions.
Cleaned up charset.c
Removed non fatal memory leak in charset.c
include/my_sys.h:
Enchanced my_once..() functions.
mysys/charset.c:
Moved my_once_strdup() to my_once.cc
Added usage of my_once_memdup()
A lot of indentation changes.
mysys/my_once.c:
Enchanced my_once..() functions.
Diffstat (limited to 'mysys/my_once.c')
-rw-r--r-- | mysys/my_once.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysys/my_once.c b/mysys/my_once.c index 1250ce24994..e1c728897aa 100644 --- a/mysys/my_once.c +++ b/mysys/my_once.c @@ -78,6 +78,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 |