24#ifndef MEMORY_DEBUGGING_INCLUDED
25#define MEMORY_DEBUGGING_INCLUDED
37#include <valgrind/valgrind.h>
39#define MEM_MALLOCLIKE_BLOCK(p1, p2, p3, p4) \
40 VALGRIND_MALLOCLIKE_BLOCK(p1, p2, p3, p4)
41#define MEM_FREELIKE_BLOCK(p1, p2) VALGRIND_FREELIKE_BLOCK(p1, p2)
42#include <valgrind/memcheck.h>
44#define MEM_UNDEFINED(a, len) VALGRIND_MAKE_MEM_UNDEFINED(a, len)
45#define MEM_DEFINED_IF_ADDRESSABLE(a, len) \
46 VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(a, len)
47#define MEM_NOACCESS(a, len) VALGRIND_MAKE_MEM_NOACCESS(a, len)
48#define MEM_CHECK_ADDRESSABLE(a, len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a, len)
52#define MEM_MALLOCLIKE_BLOCK(p1, p2, p3, p4) \
55#define MEM_FREELIKE_BLOCK(p1, p2) \
58#define MEM_UNDEFINED(a, len) ((void)0)
59#define MEM_DEFINED_IF_ADDRESSABLE(a, len) ((void)0)
60#define MEM_NOACCESS(a, len) ((void)0)
61#define MEM_CHECK_ADDRESSABLE(a, len) ((void)0)
65#if !defined(NDEBUG) || defined(HAVE_VALGRIND)
79inline void TRASH(
void *,
size_t) {}
#define MEM_CHECK_ADDRESSABLE(a, len)
Definition: memory_debugging.h:61
void TRASH(void *ptr, size_t length)
Put bad content in memory to be sure it will segfault if dereferenced.
Definition: memory_debugging.h:71
#define MEM_UNDEFINED(a, len)
Definition: memory_debugging.h:58
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76