Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Valgrind.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Debug_Valgrind_h_
5#define _Stroika_Foundation_Debug_Valgrind_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9/**
10 * \file
11 *
12 * \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
13 *
14 * \brief Support for running under valgrind memcheck - the only valgrind tool Stroika supports (see Documentation/Debugging.md)
15 *
16 * Memcheck needs nothing from here to work. This provides IsRunningUnderValgrind (), and - when configured with
17 * --valgrind enable, which defines qStroika_FeatureSupported_Valgrind - memcheck's client requests (<valgrind/memcheck.h>).
18 * It includes nothing else, so it is cheap to include anywhere.
19 *
20 * @see https://github.com/svn2github/valgrind
21 * @see https://sourceforge.net/u/lluct/me722-cm/ci/master/tree/external/valgrind/main/memcheck/memcheck.h
22 * @see https://lists.sourceforge.net/lists/listinfo/valgrind-developers
23 *
24 * TODO:
25 * @todo
26 *
27 */
28
29#ifndef qStroika_FeatureSupported_Valgrind
30#define qStroika_FeatureSupported_Valgrind 0
31#endif
32
33#if qStroika_FeatureSupported_Valgrind
34#include <valgrind/memcheck.h>
35#endif
36
37/**
38 * Use IsRunningUnderValgrind () to test if we are running under valgrind. This often
39 * uses MUCH more memory and runs much slower (details depend on if running under memcheck or which we blurr,
40 * so this isn't perfect).
41 *
42 * \note This can be called whether or not qStroika_FeatureSupported_Valgrind is defined, but it always returns false if qStroika_FeatureSupported_Valgrind is not defined.
43 *
44 */
46
47/*
48 ********************************************************************************
49 ***************************** Implementation Details ***************************
50 ********************************************************************************
51 */
52#include "Valgrind.inl"
53
54#endif /*_Stroika_Foundation_Debug_Valgrind_h_*/
bool IsRunningUnderValgrind()