From b4563ab2dfe1e553bfe48d50592823ff13a49692 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 4 Feb 2022 17:18:41 +0100 Subject: Cleanup: avoid generating some functions in all translation units Every translation unit that included the modified headers generated some extra code, even though it was not used. This adds unnecessary compile time overhead and is annoying when investigating the generated assembly. --- source/blender/blenlib/BLI_enumerable_thread_specific.hh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_enumerable_thread_specific.hh b/source/blender/blenlib/BLI_enumerable_thread_specific.hh index b5981028893..ce7df1ff4b9 100644 --- a/source/blender/blenlib/BLI_enumerable_thread_specific.hh +++ b/source/blender/blenlib/BLI_enumerable_thread_specific.hh @@ -28,10 +28,12 @@ namespace blender::threading { +#ifndef WITH_TBB namespace enumerable_thread_specific_utils { inline std::atomic next_id = 0; inline thread_local int thread_id = next_id.fetch_add(1, std::memory_order_relaxed); } // namespace enumerable_thread_specific_utils +#endif /** * This is mainly a wrapper for `tbb::enumerable_thread_specific`. The wrapper is needed because we -- cgit v1.2.3