12#include "vecmem/memory/details/memory_resource_base.hpp"
13#include "vecmem/memory/memory_resource.hpp"
14#include "vecmem/vecmem_core_export.hpp"
24class choice_memory_resource_impl;
46 std::function<memory_resource&(std::size_t, std::size_t)>
decision);
69 virtual void*
do_allocate(std::size_t, std::size_t)
override final;
73 std::size_t)
override final;
78 std::unique_ptr<details::choice_memory_resource_impl> m_impl;
This memory resource conditionally allocates memory.
Definition choice_memory_resource.hpp:34
VECMEM_CORE_EXPORT choice_memory_resource & operator=(choice_memory_resource &&rhs)
Move assignment operator.
choice_memory_resource & operator=(const choice_memory_resource &)=delete
Disallow copying the memory resource.
virtual VECMEM_CORE_EXPORT void * do_allocate(std::size_t, std::size_t) override final
Allocate memory with one of the underlying resources.
choice_memory_resource(const choice_memory_resource &)=delete
Disallow copying the memory resource.
VECMEM_CORE_EXPORT choice_memory_resource(choice_memory_resource &&parent)
Move constructor.
VECMEM_CORE_EXPORT ~choice_memory_resource()
Destructor.
virtual VECMEM_CORE_EXPORT void do_deallocate(void *p, std::size_t, std::size_t) override final
De-allocate a previously allocated memory block.
Base class for implementations of the vecmem::memory_resource interface.
Definition memory_resource_base.hpp:25
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35