dxFeed Graal CXX API
v8.1.0
Loading...
Searching...
No Matches
SanitizerCanary.hpp
1
// Copyright (c) 2026 Devexperts LLC.
2
// SPDX-License-Identifier: MPL-2.0
3
4
#
pragma
once
5
6
// Deliberately defective functions compiled into the library only in sanitized builds (DXFCXX_SANITIZERS_ENABLED).
7
// The sanitizer canary tests call them and expect the sanitizer report: this proves that the sanitizer is active and
8
// that the LIBRARY code (not only the test code) is instrumented. Not part of the public API; not installed.
9
10
#
include
"../../include/dxfeed_graal_cpp_api/internal/Conf.hpp"
11
12
DXFCPP_BEGIN_NAMESPACE
13
14
namespace
internal::sanitizer_canary {
15
16
/// Writes one element past the end of a heap array (AddressSanitizer: heap-buffer-overflow).
17
DXFCPP_EXPORT
int
heapBufferOverflow();
18
19
/// Returns `value + 1` without an overflow check (UndefinedBehaviorSanitizer: signed integer overflow for INT_MAX).
20
DXFCPP_EXPORT
int
signedOverflow(
int
value);
21
22
/// Increments a global counter from two threads without synchronization (ThreadSanitizer: data race).
23
DXFCPP_EXPORT
int
dataRace();
24
25
}
// namespace internal::sanitizer_canary
26
27
DXFCPP_END_NAMESPACE
DXFCPP_END_NAMESPACE
#define DXFCPP_END_NAMESPACE
Definition
Conf.hpp:97
DXFCPP_BEGIN_NAMESPACE
#define DXFCPP_BEGIN_NAMESPACE
Definition
Conf.hpp:94
DXFCPP_EXPORT
#define DXFCPP_EXPORT
Definition
api.h:35
src
internal
SanitizerCanary.hpp
Generated by
1.13.2