summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-01-20 17:59:11 +0100
committerSergei Golubchik <serg@mariadb.org>2018-01-22 11:39:54 +0100
commit22ae3843db6c8b2a84ca5d16cd99025abb52cc27 (patch)
tree78cd7d2f09ac106939cdfdb81e5677ceb9135e22 /mysys
parent204cb85aab3e6326e9f7a51c478efd6fad44801a (diff)
downloadmariadb-git-22ae3843db6c8b2a84ca5d16cd99025abb52cc27.tar.gz
Correct TRASH() macro usage
TRASH was mapped to TRASH_FREE and was supposed to be used for memory that should not be accessed anymore, while TRASH_ALLOC() is to be used for uninitialized but to-be-used memory. But sometimes TRASH() was used in the latter sense. Remove TRASH() macro, always use explicit TRASH_ALLOC() or TRASH_FREE().
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_alloc.c2
-rw-r--r--mysys/my_thr_init.c2
2 files changed, 1 insertions, 3 deletions
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index 1054db6cee4..d7bc4247556 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -293,7 +293,7 @@ void *multi_alloc_root(MEM_ROOT *root, ...)
DBUG_RETURN((void*) start);
}
-#define TRASH_MEM(X) TRASH(((char*)(X) + ((X)->size-(X)->left)), (X)->left)
+#define TRASH_MEM(X) TRASH_FREE(((char*)(X) + ((X)->size-(X)->left)), (X)->left)
/* Mark all data in blocks free for reusage */
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index aefd3564185..55ee1db657e 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -423,8 +423,6 @@ void my_thread_end(void)
if (--THR_thread_count == 0)
mysql_cond_signal(&THR_COND_threads);
mysql_mutex_unlock(&THR_LOCK_threads);
-
- TRASH(tmp, sizeof(*tmp));
free(tmp);
}
}