diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-12 18:23:42 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-12 18:25:35 +0300 |
commit | be33124c9dc284c4409d02e5405de568b467a167 (patch) | |
tree | 7188f6effdace66ce24af17fd1bd0d89f5b76999 /include | |
parent | fe8181aca13cf7ba1835fa6c89f297a1d0e79856 (diff) | |
parent | 15c1ab52a9f2827724c5d007ce7b8c607dc8f0a9 (diff) | |
download | mariadb-git-be33124c9dc284c4409d02e5405de568b467a167.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'include')
-rw-r--r-- | include/my_valgrind.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/my_valgrind.h b/include/my_valgrind.h index 7c2bc8aa3d4..04116e556ce 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -55,12 +55,19 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */ #endif /* HAVE_VALGRIND_MEMCHECK_H */ #ifndef DBUG_OFF +/* NOTE: Do not invoke TRASH_FILL directly! Use TRASH_ALLOC or TRASH_FREE. + +The MEM_UNDEFINED() call before memset() is for canceling the effect +of any previous MEM_NOACCESS(). We must invoke MEM_UNDEFINED() after +writing the dummy pattern, unless MEM_NOACCESS() is going to be invoked. +On AddressSanitizer, the MEM_UNDEFINED() in TRASH_ALLOC() has no effect. */ #define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0) #else #define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0) #endif - +/** Note that some memory became allocated or uninitialized. */ #define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0) +/** Note that some memory became freed. (Prohibit further access to it.) */ #define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0) #endif /* MY_VALGRIND_INCLUDED */ |