diff options
author | monty@hundin.mysql.fi <> | 2001-10-17 19:39:39 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-10-17 19:39:39 +0300 |
commit | 0bfec316ce62bf5f46b55888a0a9d593171c4eb5 (patch) | |
tree | a99a119a594cef911c36b9e84ddb7975f5747e05 /mysys/my_alloc.c | |
parent | faa51dc2854d2a2e0fe09cad44702f57d26109ae (diff) | |
download | mariadb-git-0bfec316ce62bf5f46b55888a0a9d593171c4eb5.tar.gz |
Don't do signal() on windows (Causes instability problems)
Safer, a bit faster filesort.
Code changes to avoid calls to current_thd() (faster code).
Removed all compiler warnings from readline.
Diffstat (limited to 'mysys/my_alloc.c')
-rw-r--r-- | mysys/my_alloc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index fe9431ff57a..5f3bc385c39 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -195,10 +195,17 @@ void set_prealloc_root(MEM_ROOT *root, char *ptr) char *strdup_root(MEM_ROOT *root,const char *str) { - uint len= (uint) strlen(str)+1; + return strmake_root(root, str, strlen(str)); +} + +char *strmake_root(MEM_ROOT *root,const char *str, uint len) +{ char *pos; - if ((pos=alloc_root(root,len))) + if ((pos=alloc_root(root,len+1))) + { memcpy(pos,str,len); + pos[len]=0; + } return pos; } |