Skip to content

Commit d28175b

Browse files
committed
Upgrade valgrind headers to 3.7, silencing build breakage on FreeBSD.
1 parent a9e7bff commit d28175b

File tree

2 files changed

+851
-1573
lines changed

2 files changed

+851
-1573
lines changed

src/rt/vg/memcheck.h

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
This file is part of MemCheck, a heavyweight Valgrind tool for
1414
detecting memory errors.
1515
16-
Copyright (C) 2000-2010 Julian Seward. All rights reserved.
16+
Copyright (C) 2000-2011 Julian Seward. All rights reserved.
1717
1818
Redistribution and use in source and binary forms, with or without
1919
modification, are permitted provided that the following conditions
@@ -169,7 +169,7 @@ typedef
169169
#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len) \
170170
VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
171171
VG_USERREQ__CHECK_MEM_IS_DEFINED, \
172-
(_qzz_addr), (_qzz_len), 0, 0, 0);
172+
(_qzz_addr), (_qzz_len), 0, 0, 0)
173173

174174
/* Use this macro to force the definedness and addressibility of an
175175
lvalue to be checked. If suitable addressibility and definedness
@@ -184,19 +184,27 @@ typedef
184184

185185
/* Do a full memory leak check (like --leak-check=full) mid-execution. */
186186
#define VALGRIND_DO_LEAK_CHECK \
187-
{unsigned long _qzz_res __attribute((unused)); \
188-
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
189-
VG_USERREQ__DO_LEAK_CHECK, \
190-
0, 0, 0, 0, 0); \
191-
}
187+
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK, \
188+
0, 0, 0, 0, 0)
189+
190+
/* Same as VALGRIND_DO_LEAK_CHECK but only showing the entries for
191+
which there was an increase in leaked bytes or leaked nr of blocks
192+
since the previous leak search. */
193+
#define VALGRIND_DO_ADDED_LEAK_CHECK \
194+
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK, \
195+
0, 1, 0, 0, 0)
196+
197+
/* Same as VALGRIND_DO_ADDED_LEAK_CHECK but showing entries with
198+
increased or decreased leaked bytes/blocks since previous leak
199+
search. */
200+
#define VALGRIND_DO_CHANGED_LEAK_CHECK \
201+
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK, \
202+
0, 2, 0, 0, 0)
192203

193204
/* Do a summary memory leak check (like --leak-check=summary) mid-execution. */
194-
#define VALGRIND_DO_QUICK_LEAK_CHECK \
195-
{unsigned long _qzz_res __attribute((unused)); \
196-
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
197-
VG_USERREQ__DO_LEAK_CHECK, \
198-
1, 0, 0, 0, 0); \
199-
}
205+
#define VALGRIND_DO_QUICK_LEAK_CHECK \
206+
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK, \
207+
1, 0, 0, 0, 0)
200208

201209
/* Return number of leaked, dubious, reachable and suppressed bytes found by
202210
all previous leak checks. They must be lvalues. */
@@ -207,10 +215,10 @@ typedef
207215
are. We also initialise '_qzz_leaked', etc because
208216
VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as
209217
defined. */ \
210-
{unsigned long _qzz_res __attribute((unused)); \
218+
{ \
211219
unsigned long _qzz_leaked = 0, _qzz_dubious = 0; \
212220
unsigned long _qzz_reachable = 0, _qzz_suppressed = 0; \
213-
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
221+
VALGRIND_DO_CLIENT_REQUEST_STMT( \
214222
VG_USERREQ__COUNT_LEAKS, \
215223
&_qzz_leaked, &_qzz_dubious, \
216224
&_qzz_reachable, &_qzz_suppressed, 0); \
@@ -229,10 +237,10 @@ typedef
229237
are. We also initialise '_qzz_leaked', etc because
230238
VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as
231239
defined. */ \
232-
{unsigned long _qzz_res __attribute((unused)); \
240+
{ \
233241
unsigned long _qzz_leaked = 0, _qzz_dubious = 0; \
234242
unsigned long _qzz_reachable = 0, _qzz_suppressed = 0; \
235-
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
243+
VALGRIND_DO_CLIENT_REQUEST_STMT( \
236244
VG_USERREQ__COUNT_LEAK_BLOCKS, \
237245
&_qzz_leaked, &_qzz_dubious, \
238246
&_qzz_reachable, &_qzz_suppressed, 0); \
@@ -252,10 +260,11 @@ typedef
252260
The metadata is not copied in cases 0, 2 or 3 so it should be
253261
impossible to segfault your system by using this call.
254262
*/
255-
#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) \
256-
VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
257-
VG_USERREQ__GET_VBITS, \
258-
(char*)(zza), (char*)(zzvbits), \
263+
#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) \
264+
(unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
265+
VG_USERREQ__GET_VBITS, \
266+
(const char*)(zza), \
267+
(char*)(zzvbits), \
259268
(zznbytes), 0, 0)
260269

261270
/* Set the validity data for addresses [zza..zza+zznbytes-1], copying it
@@ -267,10 +276,11 @@ typedef
267276
The metadata is not copied in cases 0, 2 or 3 so it should be
268277
impossible to segfault your system by using this call.
269278
*/
270-
#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) \
271-
VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
272-
VG_USERREQ__SET_VBITS, \
273-
(char*)(zza), (char*)(zzvbits), \
279+
#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) \
280+
(unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
281+
VG_USERREQ__SET_VBITS, \
282+
(const char*)(zza), \
283+
(const char*)(zzvbits), \
274284
(zznbytes), 0, 0 )
275285

276286
#endif

0 commit comments

Comments
 (0)