summaryrefslogtreecommitdiff
path: root/mysys/my_malloc.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-10 19:55:54 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-10 19:55:54 +0200
commit172f5e28ba9efceb3d3cee40c8373d2ee66f7c7a (patch)
tree2699ed6525a405595de40da2ec5e31793ee63f16 /mysys/my_malloc.c
parent02b8232629807ca3e37b99489f8191c549f7569a (diff)
downloadmariadb-git-172f5e28ba9efceb3d3cee40c8373d2ee66f7c7a.tar.gz
add safemalloc back
... but differently client/mysqltest.cc: my_safe_print_str() don't append \n anymore dbug/dbug.c: restore safemalloc as a part of dbug suite dbug/user.r: restore 'S' flag documentation include/my_dbug.h: restore safemalloc as a part of dbug suite include/my_sys.h: move valgrind defines to a dedicated header mysys/my_malloc.c: use new safemalloc mysys/stacktrace.c: don't append \n. let the calller do it, if needed sql/mysqld.cc: my_safe_print_str() don't append \n anymore
Diffstat (limited to 'mysys/my_malloc.c')
-rw-r--r--mysys/my_malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index 2b76af2da33..c1bfb89c1fd 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -35,10 +35,10 @@ void *my_malloc(size_t size, myf my_flags)
if (!size)
size=1;
- point= malloc(size);
+ point= DBUG_MALLOC(size);
DBUG_EXECUTE_IF("simulate_out_of_memory",
{
- free(point);
+ my_free(point);
point= NULL;
});
@@ -81,7 +81,7 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags)
DBUG_ASSERT(size > 0);
if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR))
DBUG_RETURN(my_malloc(size, my_flags));
- if ((point= realloc(oldpoint, size)) == NULL)
+ if ((point= DBUG_REALLOC(oldpoint, size)) == NULL)
{
if (my_flags & MY_FREE_ON_ERROR)
my_free(oldpoint);
@@ -107,7 +107,7 @@ void my_free(void *ptr)
{
DBUG_ENTER("my_free");
DBUG_PRINT("my",("ptr: %p", ptr));
- free(ptr);
+ DBUG_FREE(ptr);
DBUG_VOID_RETURN;
}