Optional memory management using a memory pool such as Umpire (https://github.com/LLNL/Umpire). More...
#include <MemoryPool.H>
Static Public Member Functions | |
| static bool | create (bool verbose=false) |
| Create a memory pool instance (if not already active). | |
| static void | destroy (bool verbose=false) |
| Remove the memory pool instance (currently does nothing). | |
| static bool | active () noexcept |
| True if pool is active (ie, created and not suspended). | |
| static bool | suspend () noexcept |
| Suspend use of memory pool (for allocation). | |
| static void | resume () noexcept |
| Resume use of memory pool (if previously active). | |
| static bool | is_pool (void *ptr) |
| Test if given pointer belongs to the pool. | |
| static void * | try_allocate (std::size_t nbytes) |
| Allocate from pool (if active). | |
| static bool | try_deallocate (void *ptr) |
| Deallocate a pointer managed by the pool. | |
Optional memory management using a memory pool such as Umpire (https://github.com/LLNL/Umpire).
When compiled with Umpire, its use can be controlled by the FOAM_MEMORY_POOL environment variable, or the memory_pool Optimisation switch (etc/controlDict).
It currently looks for any of the following entries, in this order:
The parameters "size=nn" and "incr=nn" (in MegaBytes) can be used to specify alternatives to the default sizing.
Definition at line 58 of file MemoryPool.H.
|
static |
Create a memory pool instance (if not already active).
Uses environment or etc/controlDict entry
Referenced by argList::parse().

|
static |
Remove the memory pool instance (currently does nothing).
|
staticnoexcept |
True if pool is active (ie, created and not suspended).
References Foam::noexcept.
|
staticnoexcept |
Suspend use of memory pool (for allocation).
References Foam::noexcept, and suspend().
Referenced by suspend().


|
staticnoexcept |
Resume use of memory pool (if previously active).
References Foam::noexcept, and resume().
Referenced by resume().


|
static |
|
static |
Allocate from pool (if active).
References try_allocate().
Referenced by Foam::ListPolicy::allocate(), and try_allocate().


|
static |
Deallocate a pointer managed by the pool.
References try_deallocate().
Referenced by Foam::ListPolicy::deallocate(), Foam::ListPolicy::deallocate(), and try_deallocate().

