mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.2 to 10.3
This commit is contained in:
@@ -55,12 +55,19 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
|
||||
#endif /* HAVE_VALGRIND_MEMCHECK_H */
|
||||
|
||||
#if defined(TRASH_FREED_MEMORY)
|
||||
/* 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)
|
||||
#define TRASH_FILL(A,B,C) 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 */
|
||||
|
Reference in New Issue
Block a user