diff options
author | Jacques Lucke <jacques@blender.org> | 2022-02-04 19:18:41 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-02-04 19:18:56 +0300 |
commit | b4563ab2dfe1e553bfe48d50592823ff13a49692 (patch) | |
tree | a6ba60c3096070d0803ac43ea19d1b492ee68d87 /source/blender/blenlib/BLI_enumerable_thread_specific.hh | |
parent | 4aeb6add6e88ad551ae47e0b8d7cb7fefef30cdb (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/BLI_enumerable_thread_specific.hh')
-rw-r--r-- | source/blender/blenlib/BLI_enumerable_thread_specific.hh | 2 |
1 files changed, 2 insertions, 0 deletions
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<int> 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 |