diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-12 14:46:28 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-12 14:46:28 +0300 |
commit | 15c1ab52a9f2827724c5d007ce7b8c607dc8f0a9 (patch) | |
tree | 435451a74686e6c590570a124f2daf80ee1c1d31 | |
parent | 7a9e1fcd455bfa8e3d71fabb6b76769433567508 (diff) | |
parent | 1217e4a0c05eff7a394e46e64dffc849c9edda22 (diff) | |
download | mariadb-git-15c1ab52a9f2827724c5d007ce7b8c607dc8f0a9.tar.gz |
Merge 5.5 into 10.1
-rw-r--r-- | include/my_valgrind.h | 10 | ||||
-rw-r--r-- | storage/innobase/include/data0type.ic | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/my_valgrind.h b/include/my_valgrind.h index ad22f0cad40..7a56b28c0f0 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Monty Program Ab +/* Copyright (C) 2010, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,11 +55,19 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */ #endif /* HAVE_VALGRIND */ #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 */ diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index 9d1d6d58b6e..b06a58cd3ab 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software |