Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
TSANSuppressions.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2026 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#ifdef JPH_TSAN_ENABLED
8
10JPH_CLANG_SUPPRESS_WARNING("-Wreserved-identifier")
11
12// Suppress TSAN data race reports that are known to be benign. Include this file in exactly one cpp file of an executable.
13extern "C" const char *__tsan_default_suppressions();
14extern "C" const char *__tsan_default_suppressions()
15{
16 return
17 // BodyManager::TryGetBody reads mBodies.size() without taking mBodiesMutex while BodyManager::AddBody can push_back to it.
18 // mBodies is reserved at Init time so it never reallocates and it only grows. A thread that obtained the body ID has already observed
19 // a size that is larger than the index of the body, so a concurrent add cannot change the outcome. JPH_TSAN_NO_SANITIZE cannot be
20 // used here because the race is reported in Array::size(), which doesn't get inlined into a function with a different sanitizer setting.
21 "race:JPH::BodyManager::TryGetBody\n"
22 #ifdef JPH_USE_VK
23 // Data races inside the Vulkan driver (e.g. Mesa llvmpipe)
24 "race:libvulkan\n"
25 #endif
26 ;
27}
28
30
31#endif
#define JPH_CLANG_SUPPRESS_WARNING(w)
Definition Core.h:341
#define JPH_SUPPRESS_WARNING_POP
Definition ShaderCore.h:38
#define JPH_SUPPRESS_WARNING_PUSH
Definition ShaderCore.h:37