diff options
author | unknown <knielsen@mysql.com> | 2006-05-15 18:07:18 +0200 |
---|---|---|
committer | unknown <knielsen@mysql.com> | 2006-05-15 18:07:18 +0200 |
commit | a046322b4e61aaef3db9efc9e85477792085c453 (patch) | |
tree | c90b581837f256bc8b3e0cb47cafcb159c99a19f /include/my_dbug.h | |
parent | 0a22763fa621e0d376e3e72febe2ad5df008a202 (diff) | |
download | mariadb-git-a046322b4e61aaef3db9efc9e85477792085c453.tar.gz |
Fix two Valgrind memory leak warnings.
client/mysqlbinlog.cc:
Now my_end() deallocates DBUG by default, but that fails in mysqlbinlog
because of global destructors that use DBUG.
dbug/dbug.c:
Add a facility to deallocate the debug stack, to avoid memory leak warnings
in Valgrind.
include/my_dbug.h:
Add a facility to deallocate the debug stack, to avoid memory leak warnings
in Valgrind.
include/my_sys.h:
Change my_end() to deallocate DBUG memory by default (can be disabled with
MY_DONT_FREE_DBUG option).
libmysql/libmysql.c:
Do not deallocate DBUG during cleanup.
mysys/my_init.c:
Change my_end() to deallocate DBUG memory by default (can be disabled with
MY_DONT_FREE_DBUG option).
sql/mysqld.cc:
Add missing my_thread_end() call, seems to occasionally trigger a memory
leak (not repeatable).
Diffstat (limited to 'include/my_dbug.h')
-rw-r--r-- | include/my_dbug.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/my_dbug.h b/include/my_dbug.h index b76a3fcc8c9..6e60b599f53 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -40,6 +40,7 @@ extern void _db_doprnt_ _VARARGS((const char *format,...)); extern void _db_dump_(uint _line_,const char *keyword,const char *memory, uint length); extern void _db_output_(uint flag); +extern void _db_end_(void); extern void _db_lock_file(void); extern void _db_unlock_file(void); @@ -66,6 +67,7 @@ extern void _db_unlock_file(void); #define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr) #define DEBUGGER_OFF _no_db_=1;_db_on_=0; #define DEBUGGER_ON _no_db_=0 +#define DBUG_END() _db_end_ () #define DBUG_LOCK_FILE { _db_lock_file(); } #define DBUG_UNLOCK_FILE { _db_unlock_file(); } #define DBUG_OUTPUT(A) { _db_output_(A); } @@ -90,6 +92,7 @@ extern void _db_unlock_file(void); #define DBUG_IN_USE 0 #define DEBUGGER_OFF #define DEBUGGER_ON +#define DBUG_END() #define DBUG_LOCK_FILE #define DBUG_UNLOCK_FILE #define DBUG_OUTPUT(A) |