pike.git / src / pike_memory.h

version» Context lines:

pike.git/src/pike_memory.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_memory.h,v 1.51 2005/05/25 16:59:39 grubba Exp $ + || $Id: pike_memory.h,v 1.52 2006/07/02 00:05:45 mast Exp $   */      #ifndef MEMORY_H   #define MEMORY_H      #include "global.h"   #include "stralloc.h"      #ifdef USE_VALGRIND    -  + #define HAVE_VALGRIND_MACROS + /* Assume that any of the following header files have the macros we +  * need. Haven't checked if it's true or not. */ +    #ifdef HAVE_MEMCHECK_H   #include <memcheck.h>   #elif defined(HAVE_VALGRIND_MEMCHECK_H)   #include <valgrind/memcheck.h>   #elif defined(HAVE_VALGRIND_H)   #include <valgrind.h> -  + #else + #undef HAVE_VALGRIND_MACROS   #endif    -  + #endif /* USE_VALGRIND */ +  + #ifdef HAVE_VALGRIND_MACROS +    /* No Access */   #define PIKE_MEM_NA(lvalue) do { \    PIKE_MEM_NA_RANGE(&(lvalue), sizeof (lvalue)); \    } while (0)   #define PIKE_MEM_NA_RANGE(addr, bytes) do { \    VALGRIND_DISCARD(VALGRIND_MAKE_NOACCESS(addr, bytes)); \    } while (0)      /* Write Only -- Will become RW when having been written to */   #define PIKE_MEM_WO(lvalue) do { \
pike.git/src/pike_memory.h:49:   #define PIKE_MEM_RO(lvalue) do { \    PIKE_MEM_RO_RANGE(&(lvalue), sizeof (lvalue)); \    } while (0)   #define PIKE_MEM_RO_RANGE(addr, bytes) do { \    VALGRIND_DISCARD(VALGRIND_MAKE_READABLE(addr, bytes)); \    } while (0)      /* Return true if a memchecker is in use. */   #define PIKE_MEM_CHECKER() RUNNING_ON_VALGRIND    - #else + #else /* !HAVE_VALGRIND_MACROS */      #define PIKE_MEM_NA(lvalue) do {} while (0)   #define PIKE_MEM_NA_RANGE(addr, bytes) do {} while (0)   #define PIKE_MEM_WO(lvalue) do {} while (0)   #define PIKE_MEM_WO_RANGE(addr, bytes) do {} while (0)   #define PIKE_MEM_RW(lvalue) do {} while (0)   #define PIKE_MEM_RW_RANGE(addr, bytes) do {} while (0)   #define PIKE_MEM_RO(lvalue) do {} while (0)   #define PIKE_MEM_RO_RANGE(addr, bytes) do {} while (0)   #define PIKE_MEM_CHECKER() 0    - #endif /* USE_VALGRIND */ + #endif /* !HAVE_VALGRIND_MACROS */         #define MEMSEARCH_LINKS 512      struct link   {    struct link *next;    INT32 key;    ptrdiff_t offset;   };