1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/* Copyright (C) 2001-2019 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
CA 94945, U.S.A., +1(415)492-9861, for further information.
*/
/* $Id:$ */
/* This header provides stubbed out definitions for the valgrind/memcheck
* client requests that do nothing. This allows us to use these requests
* in the gs source without requiring that Valgrind is available on our
* target platform.
*
* To enable the macros, simply predefine HAVE_VALGRIND, whereupon this
* file will #include "valgrind/memcheck.h" and get the real versions.
*
* This mechanism has been chosen over the more traditional "copy memcheck.h
* into your code" approach as not all our platforms support valgrind, and
* we'd rather avoid the (albeit small) overhead that the client requests
* cost at runtime when valgrind is not in use. Also, this protects us from
* changes in valgrind/memcheck.h between valgrind releases.
*/
#ifndef valgrind_INCLUDED
# define valgrind_INCLUDED
#ifdef HAVE_VALGRIND
/* Enabled, so get the real header from the system. */
#include "valgrind/memcheck.h"
#include "valgrind/helgrind.h"
/* At least some versions of valgrind/helgrind don't define this */
#ifndef VALGRIND_HG_DISABLE_CHECKING
#define VALGRIND_HG_DISABLE_CHECKING(addr, len) \
DO_NOTHING
#endif
#else
/* Disabled, so just stub the calls out */
#include "stdpre.h"
/* Stub out the Valgrind memcheck functions here */
#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len) \
DO_NOTHING
#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) \
DO_NOTHING
#define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len) \
DO_NOTHING
#define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len) \
DO_NOTHING
#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc) \
DO_NOTHING
#define VALGRIND_DISCARD(_qzz_blkindex) \
DO_NOTHING
#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len) \
DO_NOTHING
#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len) \
DO_NOTHING
#define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue) \
DO_NOTHING
#define VALGRIND_DO_LEAK_CHECK \
DO_NOTHING
#define VALGRIND_DO_QUICK_LEAK_CHECK \
DO_NOTHING
#define VALGRIND_COUNT_LEAKS(leaked, dubious, reachable, suppressed) \
DO_NOTHING
#define VALGRIND_COUNT_LEAK_BLOCKS(leaked, dubious, reachable, suppressed) \
DO_NOTHING
#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) \
DO_NOTHING
#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) \
DO_NOTHING
#define VALGRIND_HG_DISABLE_CHECKING(addr, len) \
DO_NOTHING
#endif /* HAVE_VALGRIND */
#endif /* valgrind_INCLUDED */
|