15#ifndef dealii_vector_memory_h
16#define dealii_vector_memory_h
104template <
typename VectorType = ::Vector<
double>>
151 free(
const VectorType *
const) = 0;
163 "You are trying to deallocate a vector from a memory pool, but this "
164 "vector has not actually been allocated by the same pool before.");
189 :
public std::unique_ptr<VectorType, std::function<void(VectorType *)>>
236template <
typename VectorType = ::Vector<
double>>
283 free(
const VectorType *
const v)
override;
313template <
typename VectorType = ::Vector<
double>>
376 free(
const VectorType *
const)
override;
397 using entry_type = std::pair<bool, std::unique_ptr<VectorType>>;
464 namespace GrowingVectorMemoryImplementation
477template <
typename VectorType>
479 :
std::unique_ptr<VectorType,
std::function<void(VectorType *)>>(
481 [&mem](VectorType *v) { mem.
free(v); })
486template <
typename VectorType>
490 return new VectorType();
495template <
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