From b40af05816c6d7916f0f735157e031b9ab8d906f Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 6 Aug 2024 13:34:40 -0400 Subject: [PATCH] thread_local static in wrong project --- CMakeLists.txt | 2 +- src/transformers.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5aef8e0..43e062b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(blt-gp VERSION 0.0.120) +project(blt-gp VERSION 0.0.121) include(CTest) diff --git a/src/transformers.cpp b/src/transformers.cpp index d923929..66b6e2f 100644 --- a/src/transformers.cpp +++ b/src/transformers.cpp @@ -80,8 +80,11 @@ namespace blt::gp stack_allocator& c2_stack = c2.get_values(); // we have to make a copy because we will modify the underlying storage. - std::vector c1_operators; - std::vector c2_operators; + static thread_local std::vector c1_operators; + static thread_local std::vector c2_operators; + + c1_operators.clear(); + c2_operators.clear(); for (const auto& op : blt::iterate(crossover_point_begin_itr, crossover_point_end_itr)) c1_operators.push_back(op);