16#ifndef dealii_vector_memory_h
17#define dealii_vector_memory_h
105template <
typename VectorType = ::Vector<
double>>
152 free(
const VectorType *
const) = 0;
164 "You are trying to deallocate a vector from a memory pool, but this "
165 "vector has not actually been allocated by the same pool before.");
190 :
public std::unique_ptr<VectorType, std::function<void(VectorType *)>>
237template <
typename VectorType = ::Vector<
double>>
284 free(
const VectorType *
const v)
override;
314template <
typename VectorType = ::Vector<
double>>
377 free(
const VectorType *
const)
override;
398 using entry_type = std::pair<bool, std::unique_ptr<VectorType>>;
465 namespace GrowingVectorMemoryImplementation
478template <
typename VectorType>
480 :
std::unique_ptr<VectorType,
std::function<void(VectorType *)>>(
482 [&mem](VectorType *v) { mem.
free(v); })
487template <
typename VectorType>
491 return new VectorType();
496template <
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)
void release_all_unused_memory()
unsigned int global_dof_index
void initialize(const size_type size)
std::vector< entry_type > * data