From c4e60db2e442b1ef699494b614c79b20075b3d57 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 16 Nov 2018 08:53:14 -0600 Subject: [PATCH] Move filter_match_pointer to simulation.cpp to get around macOS bug --- src/simulation.cpp | 6 ++++++ src/tallies/filter.cpp | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/simulation.cpp b/src/simulation.cpp index c3d1c17b4..50bf12521 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -565,4 +565,10 @@ extern "C" void k_generation_clear() { simulation::k_generation.clear(); } extern "C" void k_generation_reserve(int i) { simulation::k_generation.reserve(i); } extern "C" int64_t work_index(int rank) { return simulation::work_index[rank]; } +// This function was moved here to get around a bug on macOS whereby an invalid +// pointer is returned for the threadprivate filter_matches +extern "C" FilterMatch* filter_match_pointer(int indx) { + return &simulation::filter_matches[indx]; +} + } // namespace openmc diff --git a/src/tallies/filter.cpp b/src/tallies/filter.cpp index 7cf54165d..fd5e38f7e 100644 --- a/src/tallies/filter.cpp +++ b/src/tallies/filter.cpp @@ -63,8 +63,7 @@ free_memory_tally_c() //============================================================================== extern "C" { - FilterMatch* filter_match_pointer(int indx) - {return &simulation::filter_matches[indx];} + // filter_match_point moved to simulation.cpp void filter_match_bins_push_back(FilterMatch* match, int val)