MySQL 8.4.0
Source Code Documentation
memory_debugging.h File Reference

Various macros useful for communicating with memory debuggers, such as Valgrind. More...

#include <string.h>

Go to the source code of this file.

Macros

#define MEM_MALLOCLIKE_BLOCK(p1, p2, p3, p4)
 
#define MEM_FREELIKE_BLOCK(p1, p2)
 
#define MEM_UNDEFINED(a, len)   ((void)0)
 
#define MEM_DEFINED_IF_ADDRESSABLE(a, len)   ((void)0)
 
#define MEM_NOACCESS(a, len)   ((void)0)
 
#define MEM_CHECK_ADDRESSABLE(a, len)   ((void)0)
 

Functions

void TRASH (void *ptr, size_t length)
 Put bad content in memory to be sure it will segfault if dereferenced. More...
 

Detailed Description

Various macros useful for communicating with memory debuggers, such as Valgrind.

Macro Definition Documentation

◆ MEM_CHECK_ADDRESSABLE

#define MEM_CHECK_ADDRESSABLE (   a,
  len 
)    ((void)0)

◆ MEM_DEFINED_IF_ADDRESSABLE

#define MEM_DEFINED_IF_ADDRESSABLE (   a,
  len 
)    ((void)0)

◆ MEM_FREELIKE_BLOCK

#define MEM_FREELIKE_BLOCK (   p1,
  p2 
)
Value:
do { \
} while (0)

◆ MEM_MALLOCLIKE_BLOCK

#define MEM_MALLOCLIKE_BLOCK (   p1,
  p2,
  p3,
  p4 
)
Value:
do { \
} while (0)

◆ MEM_NOACCESS

#define MEM_NOACCESS (   a,
  len 
)    ((void)0)

◆ MEM_UNDEFINED

#define MEM_UNDEFINED (   a,
  len 
)    ((void)0)

Function Documentation

◆ TRASH()

void TRASH ( void *  ptr,
size_t  length 
)
inline

Put bad content in memory to be sure it will segfault if dereferenced.

With Valgrind, verify that memory is addressable, and mark it undefined.