multipath-tools: sync valgrind.h with 3.12 upstream
PATCH 1/1 multipath-tools: sync valgrind.h with 3.12 upstream
Cc Bart Van Assche <[email protected]>
Cc Christophe Varoqui <[email protected]>
Cc device-mapper development <[email protected]>
Signed-off-by Xose Vazquez Perez <[email protected]>
--- third-party/valgrind/valgrind.h | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-)
third-party/valgrind/valgrind.h +37 -3
@@ -89,7 +89,7 @@|| (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6)) */ #define __VALGRIND_MAJOR__ 3 -#define __VALGRIND_MINOR__ 11 +#define __VALGRIND_MINOR__ 12#include <stdarg.h>
@@ -946,7 +946,7 @@ typedef "move %0, $11\n\t" /*result*/ \ : "=r" (_zzq_result) \: " r" (_zzq_default), " r" (&_zzq_args[0]) \ -: " $11", " $12"); \ +: " $11", " $12", " memory"); \ _zzq_result; \ })
@@ -1017,7 +1017,7 @@ typedef "move %0, $11\n\t" /*result*/ \ : "=r" (_zzq_result) \: " r" (_zzq_default), " r" (&_zzq_args[0]) \ -: " $11", " $12"); \ +: " $11", " $12", " memory"); \ _zzq_result; \ })
@@ -6759,6 +6759,7 @@ __inline VALGRIND_PRINTF(const char *format, ...) {#if defined(NVALGRIND ) +if (format) *(volatile const char *)format;/* avoid compiler warning */ return 0 ;#else /* NVALGRIND */ #if defined(_MSC_VER) || defined(__MINGW64__)
@@ -6797,6 +6798,7 @@ __inline VALGRIND_PRINTF_BACKTRACE(const char *format, ...) {#if defined(NVALGRIND ) +if (format) *(volatile const char *)format;/* avoid compiler warning */ return 0 ;#else /* NVALGRIND */ #if defined(_MSC_VER) || defined(__MINGW64__)
@@ -7007,6 +7009,38 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)VALGRIND_DO_CLIENT_REQUEST_STMT (VG_USERREQ__CREATE_MEMPOOL , \ pool, rzB, is_zeroed,0 ,0 ) +/* Create a memory pool with some flags specifying extended behaviour. +When flags is zero, the behaviour is identical to VALGRIND_CREATE_MEMPOOL. ++ The flag VALGRIND_MEMPOOL_METAPOOL specifies that the pieces of memory +associated with the pool using VALGRIND_MEMPOOL_ALLOC will be used +by the application as superblocks to dole out MALLOC_LIKE blocks using +VALGRIND_MALLOCLIKE_BLOCK. In other words, a meta pool is a "2 levels" +pool : first level is the blocks described by VALGRIND_MEMPOOL_ALLOC. +The second level blocks are described using VALGRIND_MALLOCLIKE_BLOCK. +Note that the association between the pool and the second level blocks +is implicit : second level blocks will be located inside first level +blocks. It is necessary to use the VALGRIND_MEMPOOL_METAPOOL flag +for such 2 levels pools, as otherwise valgrind will detect overlapping +memory blocks, and will abort execution (e.g. during leak search). + +Such a meta pool can also be marked as an 'auto free' pool using the flag +VALGRIND_MEMPOOL_AUTO_FREE, which must be OR-ed together with the +VALGRIND_MEMPOOL_METAPOOL. For an 'auto free' pool, VALGRIND_MEMPOOL_FREE +will automatically free the second level blocks that are contained +inside the first level block freed with VALGRIND_MEMPOOL_FREE. +In other words, calling VALGRIND_MEMPOOL_FREE will cause implicit calls +to VALGRIND_FREELIKE_BLOCK for all the second level blocks included +in the first level block. +Note: it is an error to use the VALGRIND_MEMPOOL_AUTO_FREE flag +without the VALGRIND_MEMPOOL_METAPOOL flag. +*/ +#define VALGRIND_MEMPOOL_AUTO_FREE 1 +#define VALGRIND_MEMPOOL_METAPOOL 2 +#define VALGRIND_CREATE_MEMPOOL_EXT (pool, rzB, is_zeroed, flags) \ + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL, \ + pool, rzB, is_zeroed, flags, 0) +/* Destroy a memory pool. */ #define VALGRIND_DESTROY_MEMPOOL (pool) \ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL, \
Signature · 1 line
2.11.1
Quoted 4 lines · Xose Vazquez Perez
Cc Bart Van Assche <[email protected]>Cc Christophe Varoqui <[email protected]>Cc device-mapper development <[email protected]>Signed-off-by Xose Vazquez Perez <[email protected]>
Reviewed-by Bart Van Assche <[email protected]>
Christophe Varoqui
AppliedApplied.
Quoted 105 lines · Xose Vazquez Perez
Cc Bart Van Assche <[email protected]>Cc Christophe Varoqui <[email protected]>Cc device-mapper development <[email protected]>Signed-off-by Xose Vazquez Perez <[email protected]>--- third-party/valgrind/valgrind.h | 40 ++++++++++++++++++++++++++++++ +++++++--- 1 file changed, 37 insertions(+), 3 deletions(-)third-party/valgrind/ renamed from third-party/valgrind/valgrind.h +0
-0
valgrind.h
index 4b8ef75..6892007 100644third-party/valgrind/valgrind.h +4
-3@@ -89,7 +89,7 @@|| (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6)) */ #define __VALGRIND_MAJOR__ 3 -#define __VALGRIND_MINOR__ 11 +#define __VALGRIND_MINOR__ 12#include <stdarg.h> @@ -946,7 +946,7 @@ typedef "move %0, $11\n\t" /*result*/ \ : "=r" (_zzq_result) \: " r" (_zzq_default), " r" (&_zzq_args[0]) \ -: " $11", " $12"); \ +: " $11", " $12", " memory"); \ _zzq_result; \ })@@ -1017,7 +1017,7 @@ typedef "move %0, $11\n\t" /*result*/ \ : "=r" (_zzq_result) \: " r" (_zzq_default), " r" (&_zzq_args[0]) \ -: " $11", " $12"); \ +: " $11", " $12", " memory"); \ _zzq_result; \ })@@ -6759,6 +6759,7 @@ __inline VALGRIND_PRINTF(const char *format, ...) {#if defined(NVALGRIND ) +if (format) *(volatile const char *)format;/* avoid compiler warning */
return 0;#else /* NVALGRIND */
#ifdefined(_MSC_VER)||defined(__MINGW64__)third-party/valgrind/valgrind.h +1
-0@@ -6797,6 +6798,7 @@ __inline VALGRIND_PRINTF_BACKTRACE(const char *format, ...) {#if defined(NVALGRIND ) +if (format) *(volatile const char *)format;/* avoid compiler warning */
return 0;#else /* NVALGRIND */
#ifdefined(_MSC_VER)||defined(__MINGW64__)third-party/valgrind/valgrind.h +2
-0@@ -7007,6 +7009,38 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)VALGRIND_DO_CLIENT_REQUEST_STMT (VG_USERREQ__CREATE_MEMPOOL , \ pool, rzB, is_zeroed,0 ,0 ) +/* Create a memory pool with some flags specifying extended behaviour. +When flags is zero, the behaviour is identical to
VALGRIND_CREATE_MEMPOOL.third-party/valgrind/valgrind.h +14
-0+ + The flag VALGRIND_MEMPOOL_METAPOOL specifies that the pieces of memory + associated with the pool using VALGRIND_MEMPOOL_ALLOC will be used + by the application as superblocks to dole out MALLOC_LIKE blocks using + VALGRIND_MALLOCLIKE_BLOCK. In other words, a meta pool is a "2 levels" + pool : first level is the blocks described by VALGRIND_MEMPOOL_ALLOC. + The second level blocks are described using VALGRIND_MALLOCLIKE_BLOCK. + Note that the association between the pool and the second level blocks + is implicit : second level blocks will be located inside first level + blocks. It is necessary to use the VALGRIND_MEMPOOL_METAPOOL flag + for such 2 levels pools, as otherwise valgrind will detect overlapping + memory blocks, and will abort execution (e.g. during leak search). + + Such a meta pool can also be marked as an 'auto free' pool using theflag
third-party/valgrind/valgrind.h +2
-0+ VALGRIND_MEMPOOL_AUTO_FREE, which must be OR-ed together with the + VALGRIND_MEMPOOL_METAPOOL. For an 'auto free' pool,
VALGRIND_MEMPOOL_FREEthird-party/valgrind/valgrind.h +14
-1+will automatically free the second level blocks that are contained +inside the first level block freed with VALGRIND_MEMPOOL_FREE. +In other words, calling VALGRIND_MEMPOOL_FREE will cause implicit calls +to VALGRIND_FREELIKE_BLOCK for all the second level blocks included +in the first level block. +Note: it is an error to use the VALGRIND_MEMPOOL_AUTO_FREE flag +without the VALGRIND_MEMPOOL_METAPOOL flag. +*/ +#define VALGRIND_MEMPOOL_AUTO_FREE 1 +#define VALGRIND_MEMPOOL_METAPOOL 2 +#define VALGRIND_CREATE_MEMPOOL_EXT (pool, rzB, is_zeroed, flags) \ + VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL, \ + pool, rzB, is_zeroed, flags, 0) +/* Destroy a memory pool. */ #define VALGRIND_DESTROY_MEMPOOL (pool) \ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL, \ --2.11.1