PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
memdebug.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * memdebug.h
4  * Memory debugging support.
5  *
6  * Currently, this file either wraps <valgrind/memcheck.h> or substitutes
7  * empty definitions for Valgrind client request macros we use.
8  *
9  *
10  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
11  * Portions Copyright (c) 1994, Regents of the University of California
12  *
13  * src/include/utils/memdebug.h
14  *
15  *-------------------------------------------------------------------------
16  */
17 #ifndef MEMDEBUG_H
18 #define MEMDEBUG_H
19 
20 #ifdef USE_VALGRIND
21 #include <valgrind/memcheck.h>
22 #else
23 #define VALGRIND_CHECK_MEM_IS_DEFINED(addr, size) do {} while (0)
24 #define VALGRIND_CREATE_MEMPOOL(context, redzones, zeroed) do {} while (0)
25 #define VALGRIND_DESTROY_MEMPOOL(context) do {} while (0)
26 #define VALGRIND_MAKE_MEM_DEFINED(addr, size) do {} while (0)
27 #define VALGRIND_MAKE_MEM_NOACCESS(addr, size) do {} while (0)
28 #define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) do {} while (0)
29 #define VALGRIND_MEMPOOL_ALLOC(context, addr, size) do {} while (0)
30 #define VALGRIND_MEMPOOL_FREE(context, addr) do {} while (0)
31 #define VALGRIND_MEMPOOL_CHANGE(context, optr, nptr, size) do {} while (0)
32 #endif
33 
34 #endif /* MEMDEBUG_H */