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
13
14namespace internal::sanitizer_canary {
15
16/// Writes one element past the end of a heap array (AddressSanitizer: heap-buffer-overflow).
17DXFCPP_EXPORT int heapBufferOverflow();
18
19/// Returns `value + 1` without an overflow check (UndefinedBehaviorSanitizer: signed integer overflow for INT_MAX).
20DXFCPP_EXPORT int signedOverflow(int value);
21
22/// Increments a global counter from two threads without synchronization (ThreadSanitizer: data race).
23DXFCPP_EXPORT int dataRace();
24
25} // namespace internal::sanitizer_canary
26
#define DXFCPP_END_NAMESPACE
Definition Conf.hpp:97
#define DXFCPP_BEGIN_NAMESPACE
Definition Conf.hpp:94
#define DXFCPP_EXPORT
Definition api.h:35