<div dir="ltr">Applied.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 2:37 PM, Xose Vazquez Perez <span dir="ltr"><<a href="mailto:xose.vazquez@gmail.com" target="_blank">xose.vazquez@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cc: Bart Van Assche <<a href="mailto:bart.vanassche@sandisk.com">bart.vanassche@sandisk.com</a>><br>
Cc: Christophe Varoqui <<a href="mailto:christophe.varoqui@opensvc.com">christophe.varoqui@opensvc.<wbr>com</a>><br>
Cc: device-mapper development <<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a>><br>
Signed-off-by: Xose Vazquez Perez <<a href="mailto:xose.vazquez@gmail.com">xose.vazquez@gmail.com</a>><br>
---<br>
third-party/valgrind/valgrind.<wbr>h | 40 ++++++++++++++++++++++++++++++<wbr>+++++++---<br>
1 file changed, 37 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/third-party/valgrind/<wbr>valgrind.h b/third-party/valgrind/<wbr>valgrind.h<br>
index 4b8ef75..6892007 100644<br>
--- a/third-party/valgrind/<wbr>valgrind.h<br>
+++ b/third-party/valgrind/<wbr>valgrind.h<br>
@@ -89,7 +89,7 @@<br>
|| (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))<br>
*/<br>
#define __VALGRIND_MAJOR__ 3<br>
-#define __VALGRIND_MINOR__ 11<br>
+#define __VALGRIND_MINOR__ 12<br>
<br>
<br>
#include <stdarg.h><br>
@@ -946,7 +946,7 @@ typedef<br>
"move %0, $11\n\t" /*result*/ \<br>
: "=r" (_zzq_result) \<br>
: "r" (_zzq_default), "r" (&_zzq_args[0]) \<br>
- : "$11", "$12"); \<br>
+ : "$11", "$12", "memory"); \<br>
_zzq_result; \<br>
})<br>
<br>
@@ -1017,7 +1017,7 @@ typedef<br>
"move %0, $11\n\t" /*result*/ \<br>
: "=r" (_zzq_result) \<br>
: "r" (_zzq_default), "r" (&_zzq_args[0]) \<br>
- : "$11", "$12"); \<br>
+ : "$11", "$12", "memory"); \<br>
_zzq_result; \<br>
})<br>
<br>
@@ -6759,6 +6759,7 @@ __inline<br>
VALGRIND_PRINTF(const char *format, ...)<br>
{<br>
#if defined(NVALGRIND)<br>
+ if (format) *(volatile const char *)format; /* avoid compiler warning */<br>
return 0;<br>
#else /* NVALGRIND */<br>
#if defined(_MSC_VER) || defined(__MINGW64__)<br>
@@ -6797,6 +6798,7 @@ __inline<br>
VALGRIND_PRINTF_BACKTRACE(<wbr>const char *format, ...)<br>
{<br>
#if defined(NVALGRIND)<br>
+ if (format) *(volatile const char *)format; /* avoid compiler warning */<br>
return 0;<br>
#else /* NVALGRIND */<br>
#if defined(_MSC_VER) || defined(__MINGW64__)<br>
@@ -7007,6 +7009,38 @@ VALGRIND_PRINTF_BACKTRACE(<wbr>const char *format, ...)<br>
VALGRIND_DO_CLIENT_REQUEST_<wbr>STMT(VG_USERREQ__CREATE_<wbr>MEMPOOL, \<br>
pool, rzB, is_zeroed, 0, 0)<br>
<br>
+/* Create a memory pool with some flags specifying extended behaviour.<br>
+ When flags is zero, the behaviour is identical to VALGRIND_CREATE_MEMPOOL.<br>
+<br>
+ The flag VALGRIND_MEMPOOL_METAPOOL specifies that the pieces of memory<br>
+ associated with the pool using VALGRIND_MEMPOOL_ALLOC will be used<br>
+ by the application as superblocks to dole out MALLOC_LIKE blocks using<br>
+ VALGRIND_MALLOCLIKE_BLOCK. In other words, a meta pool is a "2 levels"<br>
+ pool : first level is the blocks described by VALGRIND_MEMPOOL_ALLOC.<br>
+ The second level blocks are described using VALGRIND_MALLOCLIKE_BLOCK.<br>
+ Note that the association between the pool and the second level blocks<br>
+ is implicit : second level blocks will be located inside first level<br>
+ blocks. It is necessary to use the VALGRIND_MEMPOOL_METAPOOL flag<br>
+ for such 2 levels pools, as otherwise valgrind will detect overlapping<br>
+ memory blocks, and will abort execution (e.g. during leak search).<br>
+<br>
+ Such a meta pool can also be marked as an 'auto free' pool using the flag<br>
+ VALGRIND_MEMPOOL_AUTO_FREE, which must be OR-ed together with the<br>
+ VALGRIND_MEMPOOL_METAPOOL. For an 'auto free' pool, VALGRIND_MEMPOOL_FREE<br>
+ will automatically free the second level blocks that are contained<br>
+ inside the first level block freed with VALGRIND_MEMPOOL_FREE.<br>
+ In other words, calling VALGRIND_MEMPOOL_FREE will cause implicit calls<br>
+ to VALGRIND_FREELIKE_BLOCK for all the second level blocks included<br>
+ in the first level block.<br>
+ Note: it is an error to use the VALGRIND_MEMPOOL_AUTO_FREE flag<br>
+ without the VALGRIND_MEMPOOL_METAPOOL flag.<br>
+*/<br>
+#define VALGRIND_MEMPOOL_AUTO_FREE 1<br>
+#define VALGRIND_MEMPOOL_METAPOOL 2<br>
+#define VALGRIND_CREATE_MEMPOOL_EXT(<wbr>pool, rzB, is_zeroed, flags) \<br>
+ VALGRIND_DO_CLIENT_REQUEST_<wbr>STMT(VG_USERREQ__CREATE_<wbr>MEMPOOL, \<br>
+ pool, rzB, is_zeroed, flags, 0)<br>
+<br>
/* Destroy a memory pool. */<br>
#define VALGRIND_DESTROY_MEMPOOL(pool) \<br>
VALGRIND_DO_CLIENT_REQUEST_<wbr>STMT(VG_USERREQ__DESTROY_<wbr>MEMPOOL, \<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.1<br>
<br>
</font></span></blockquote></div><br></div>