We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e860a2 commit e88b0feCopy full SHA for e88b0fe
include/exec/static_thread_pool.hpp
@@ -447,13 +447,14 @@ namespace exec {
447
};
448
449
auto finalize = [&](auto&) {
450
- stdexec::set_value(
451
- (Receiver&&) sh_state.receiver_,
452
- std::reduce(
453
- std::ranges::begin(sh_state.partials_),
454
- std::ranges::end(sh_state.partials_),
455
- sh_state.init_,
456
- sh_state.redop_));
+ auto result = std::reduce(
+ std::ranges::begin(sh_state.partials_),
+ std::ranges::end(sh_state.partials_),
+ sh_state.init_,
+ sh_state.redop_);
+ // deallocate
+ sh_state.partials_.swap(std::vector<inrange_t>{});
457
+ stdexec::set_value((Receiver&&) sh_state.receiver_, std::move(result));
458
459
460
sh_state.apply(reducer);
0 commit comments