Blame src/vma/util/valgrind.h

Packit 6d2c1b
/*
Packit 6d2c1b
 * Copyright (c) 2001-2020 Mellanox Technologies, Ltd. All rights reserved.
Packit 6d2c1b
 *
Packit 6d2c1b
 * This software is available to you under a choice of one of two
Packit 6d2c1b
 * licenses.  You may choose to be licensed under the terms of the GNU
Packit 6d2c1b
 * General Public License (GPL) Version 2, available from the file
Packit 6d2c1b
 * COPYING in the main directory of this source tree, or the
Packit 6d2c1b
 * BSD license below:
Packit 6d2c1b
 *
Packit 6d2c1b
 *     Redistribution and use in source and binary forms, with or
Packit 6d2c1b
 *     without modification, are permitted provided that the following
Packit 6d2c1b
 *     conditions are met:
Packit 6d2c1b
 *
Packit 6d2c1b
 *      - Redistributions of source code must retain the above
Packit 6d2c1b
 *        copyright notice, this list of conditions and the following
Packit 6d2c1b
 *        disclaimer.
Packit 6d2c1b
 *
Packit 6d2c1b
 *      - Redistributions in binary form must reproduce the above
Packit 6d2c1b
 *        copyright notice, this list of conditions and the following
Packit 6d2c1b
 *        disclaimer in the documentation and/or other materials
Packit 6d2c1b
 *        provided with the distribution.
Packit 6d2c1b
 *
Packit 6d2c1b
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Packit 6d2c1b
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 6d2c1b
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Packit 6d2c1b
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
Packit 6d2c1b
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
Packit 6d2c1b
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
Packit 6d2c1b
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit 6d2c1b
 * SOFTWARE.
Packit 6d2c1b
 */
Packit 6d2c1b
Packit 6d2c1b
Packit 6d2c1b
#ifndef VMA_VALGRIND_H_
Packit 6d2c1b
#define VMA_VALGRIND_H_
Packit 6d2c1b
Packit 6d2c1b
#ifdef HAVE_CONFIG_H
Packit 6d2c1b
#  include "config.h"
Packit 6d2c1b
#endif
Packit 6d2c1b
Packit 6d2c1b
/* Valgrind compatibility */
Packit 6d2c1b
#ifndef NVALGRIND
Packit 6d2c1b
#  include <valgrind/memcheck.h>
Packit 6d2c1b
#  ifndef VALGRIND_MAKE_MEM_DEFINED
Packit 6d2c1b
#    define VALGRIND_MAKE_MEM_DEFINED(p, n)   VALGRIND_MAKE_READABLE(p, n)
Packit 6d2c1b
#  endif
Packit 6d2c1b
#  ifndef VALGRIND_MAKE_MEM_UNDEFINED
Packit 6d2c1b
#    define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE(p, n)
Packit 6d2c1b
#  endif
Packit 6d2c1b
#else
Packit 6d2c1b
#  define VALGRIND_MAKE_MEM_DEFINED(p, n)
Packit 6d2c1b
#  define VALGRIND_MAKE_MEM_UNDEFINED(p, n)
Packit 6d2c1b
#  define VALGRIND_MAKE_MEM_NOACCESS(p, n)
Packit 6d2c1b
#  define VALGRIND_CREATE_MEMPOOL(n,p,x)
Packit 6d2c1b
#  define VALGRIND_DESTROY_MEMPOOL(p)
Packit 6d2c1b
#  define VALGRIND_MEMPOOL_ALLOC(n,p,x)
Packit 6d2c1b
#  define VALGRIND_MEMPOOL_FREE(n,p)
Packit 6d2c1b
#  define RUNNING_ON_VALGRIND                0
Packit 6d2c1b
#endif
Packit 6d2c1b
Packit 6d2c1b
Packit 6d2c1b
#endif