15#ifndef dealii_vector_memory_h
16#define dealii_vector_memory_h
103template <
typename VectorType = ::Vector<
double>>
150 free(
const VectorType *
const) = 0;
162 "You are trying to deallocate a vector from a memory pool, but this "
163 "vector has not actually been allocated by the same pool before.");
188 :
public std::unique_ptr<VectorType, std::function<void(VectorType *)>>
235template <
typename VectorType = ::Vector<
double>>
282 free(
const VectorType *
const v)
override;
312template <
typename VectorType = ::Vector<
double>>
375 free(
const VectorType *
const)
override;
396 using entry_type = std::pair<bool, std::unique_ptr<VectorType>>;
463 namespace GrowingVectorMemoryImplementation
476template <
typename VectorType>
478 :
std::unique_ptr<VectorType,
std::function<void(VectorType *)>>(
480 [&mem](VectorType *v) { mem.
free(v); })
485template <
typename VectorType>
494template <
typename VectorType>
virtual VectorType * alloc() override
static void release_unused_memory()
static Threads::Mutex mutex
virtual void free(const VectorType *const) override
virtual std::size_t memory_consumption() const
virtual ~GrowingVectorMemory() override
GrowingVectorMemory(const size_type initial_size=0, const bool log_statistics=false)
std::pair< bool, std::unique_ptr< VectorType > > entry_type
virtual void free(const VectorType *const v) override
virtual VectorType * alloc() override
Pointer & operator=(Pointer &&p) noexcept=default
Pointer(Pointer &&p) noexcept=default
Pointer(VectorMemory< VectorType > &mem)
virtual VectorType * alloc()=0
virtual ~VectorMemory() override=default
virtual void free(const VectorType *const)=0
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotAllocatedHere()
#define DeclExceptionMsg(Exception, defaulttext)
Tpetra::Vector< Number, LO, GO, NodeType< MemorySpace > > VectorType
void release_all_unused_memory()
unsigned int global_dof_index
void initialize(const size_type size)
std::vector< entry_type > * data