diff options
author | unknown <guilhem@mysql.com> | 2005-10-13 00:24:14 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2005-10-13 00:24:14 +0200 |
commit | bec380588e9b4ca0db056d91d352c25a5dc9aa77 (patch) | |
tree | bbd2ff330e86869b4d2d70ea12bb6866c10a6ab2 /include | |
parent | e7ac9b928265a8138b26c2a4b297b4d4cc540073 (diff) | |
download | mariadb-git-bec380588e9b4ca0db056d91d352c25a5dc9aa77.tar.gz |
Building with compile-pentium-valgrind-max (without safemalloc) defines my_free() without flags,
so a typo on flags will go unnoticed; I put flags in this my_free() definition (as a no-op which
will still make the compiler check correctness of the flags). Applied: this caught a typo in my_realloc.c. Kindly approved by Konstantin and Mats.
include/my_sys.h:
When we define my_free(PTR,FG) to be my_no_flags_free(PTR) we don't make the compiler check
correctness of FG, which can hurt if another person build with a different definition of my_free;
so I add FG in the expression.
mysys/my_realloc.c:
typo found by the change in my_sys.h :)
Diffstat (limited to 'include')
-rw-r--r-- | include/my_sys.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index f7b85916abf..76031806b82 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -158,7 +158,8 @@ extern gptr my_memdup(const byte *from,uint length,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags); extern char *my_strdup_with_length(const byte *from, uint length, myf MyFlags); -#define my_free(PTR,FG) my_no_flags_free(PTR) +/* we do use FG (as a no-op) in below so that a typo on FG is caught */ +#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) #define CALLER_INFO_PROTO /* nothing */ #define CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */ |