32#ifndef _SIR_TESTS_MALLOC_H_INCLUDED
33# define _SIR_TESTS_MALLOC_H_INCLUDED
38mallocctl(MTDOUBLEFREE, 0);
40mallocctl(MTDOUBLEFREE, 1);
41mallocctl(MTINITBUFFER, 1);
42mallocctl(MTDEBUGPATTERN, 1);
46# if !defined(DEBUG_MALLOC_FILL_BYTE)
47# define DEBUG_MALLOC_FILL_BYTE 0x2E
51# if defined(DUMA_EXPLICIT_INIT)
54# if defined(DUMA_MIN_ALIGNMENT)
55# if DUMA_MIN_ALIGNMENT > 0
56DUMA_SET_ALIGNMENT(DUMA_MIN_ALIGNMENT);
59DUMA_SET_FILL(DEBUG_MALLOC_FILL_BYTE);
63# if defined(__GLIBC__)
64# if !defined(_GNU_SOURCE)
70# if GLIBC_VERSION >= 20400 && defined(M_PERTURB)
71mallopt(M_PERTURB, DEBUG_MALLOC_FILL_BYTE);
73# if defined(M_CHECK_ACTION)
74mallopt(M_CHECK_ACTION, 3);
79# if defined(__WIN__) && defined(DEBUG) && defined(_DEBUG)
80# if defined(_CRTDBG_CHECK_ALWAYS_DF) && \
81 defined(_CRTDBG_DELAY_FREE_MEM_DF) && \
82 defined(_CRTDBG_LEAK_CHECK_DF)
83_CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF);