Reduce dynamic allocation in functor/filtering code
In the course of opening LHCb!2472 (merged) I noticed some functor/filter code was showing up. This uses LHCb!2475 (merged) to remove some dynamic allocation, and makes some drive-by code-consistency changes in the core functor code.
Before:
-
auto prepared = m_functor.prepare()
would cause a dynamic allocation in thestd::function
type ofprepared
- Using
Pr::Filter<some_zip>
puts two objects on the TES, a non-owning zip view and an owning container of unspecified type. The latter usedstd::make_unique
so that its address is stable and the non-owning view could refer to it.
Now:
- The prepared functor type is an allocator-aware type, not
std::function
- A custom allocator/deleter is used instead of the default
std::unique_ptr<T>
allocator/deleter
Depends on LHCb!2475 (merged), needs Phys!715 (merged).
cc: @nnolte
Edited by Olli Lupton