diff options
Diffstat (limited to 'third_party/re2/util/valgrind.cc')
-rw-r--r-- | third_party/re2/util/valgrind.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/third_party/re2/util/valgrind.cc b/third_party/re2/util/valgrind.cc new file mode 100644 index 0000000..749bb59 --- /dev/null +++ b/third_party/re2/util/valgrind.cc @@ -0,0 +1,24 @@ +// Copyright 2009 The RE2 Authors. All Rights Reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "util/util.h" +#include "util/valgrind.h" + +namespace re2 { + +static bool checkValgrind() { +#ifdef RUNNING_ON_VALGRIND + return RUNNING_ON_VALGRIND; +#else + return false; +#endif +} + +static const int valgrind = checkValgrind(); + +int RunningOnValgrind() { + return valgrind; +} + +} // namespace re2 |