Advanced Multi-Physics (AMP)
On-Line Documentation
MemoryPool.h
Go to the documentation of this file.
1#ifndef included_AMP_MemoryPool
2#define included_AMP_MemoryPool
3
4
5namespace AMP {
6
7
13template<class TYPE, class INT_TYPE = int>
14class MemoryPool final
15{
16public:
18 explicit MemoryPool( size_t size );
19
22
28 inline TYPE *allocate();
29
35 inline void free( TYPE *ptr );
36
37private:
38 // Data members
39 volatile TYPE *d_objects;
40 volatile AtomicOperations::int32_atomic d_next;
41
42private:
45};
46
47
48} // namespace AMP
49
50#include "AMP/threadpool/memory_pool.hpp"
51
52#endif
Pool allocator.
Definition MemoryPool.h:15
~MemoryPool()
destructor
MemoryPool(size_t size)
Default constructor.
TYPE * allocate()
Allocate an object.
MemoryPool & operator=(const MemoryPool &)
volatile AtomicOperations::int32_atomic d_next
Definition MemoryPool.h:40
volatile TYPE * d_objects
Definition MemoryPool.h:39
void free(TYPE *ptr)
Insert an item.
MemoryPool(const MemoryPool &)



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page