Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Valgrind.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. 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 Include this file VERY EARLY ON - before including stuff like <cstdio> -
15 * to allow use of Valgrind (some features)
16 *
17 * Note - this is NOT required for use of valgrind memcheck() - at least as of v2.0a145.
18 *
19 * This module is VERY careful not to include unneded files - and includes just the minimal required to make
20 * the valgrind family of tools work IFF you preconfigure (./configure) qStroika_FeatureSupported_Valgrind to
21 * be a predefined C++ macro define.
22 *
23 * @see http://valgrind.org/docs/manual/drd-manual.html
24 * @see https://github.com/svn2github/valgrind
25 * @see https://sourceforge.net/u/lluct/me722-cm/ci/master/tree/external/valgrind/main/memcheck/memcheck.h
26 * @see https://lists.sourceforge.net/lists/listinfo/valgrind-developers
27 *
28 * TODO:
29 * @todo
30 *
31 */
32
33#ifndef qStroika_FeatureSupported_Valgrind
34#define qStroika_FeatureSupported_Valgrind 0
35#endif
36
37#if qStroika_FeatureSupported_Valgrind
38#include <valgrind/memcheck.h>
39#endif
40
41/**
42 * Use IsRunningUnderValgrind () to test if we are running under valgrind. This often
43 * uses MUCH more memory and runs much slower (details depend on if running under memcheck or which we blurr,
44 * so this isn't perfect).
45 *
46 * \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.
47 *
48 */
50
51/*
52 ********************************************************************************
53 ***************************** Implementation Details ***************************
54 ********************************************************************************
55 */
56#include "Valgrind.inl"
57
58#endif /*_Stroika_Foundation_Debug_Valgrind_h_*/
bool IsRunningUnderValgrind()