|
TrioCFD 1.9.9_beta
TrioCFD documentation
|
Pool of memory blocks used when requesting temporary storage (Trav arrays). More...
#include <TRUSTTravPool.h>
Public Types | |
| using | block_ptr_t = std::shared_ptr<std::vector<_TYPE_, TVAlloc<_TYPE_> > > |
Public Member Functions | |
| TRUSTTravPool ()=delete | |
Static Public Member Functions | |
| static block_ptr_t | GetFreeBlock (int sz) |
| Retrieve a free block of size sz. | |
| static block_ptr_t | ResizeBlock (block_ptr_t p, int new_sz) |
| "Resize" a temporary Trav block - two possible strategies: Strategy 1 | |
| static void | ReleaseBlock (block_ptr_t) |
| Release a block. | |
| static void | ClearPool () |
| Empty the TRUSTTrav pool explicitely. | |
| static void | DeleteOnDevice () |
| static void | PrintStats () |
| Debug method printing useful stats. | |
Pool of memory blocks used when requesting temporary storage (Trav arrays).
Purely static methods. One pool per base type (int, double, etc...).
The implementation details are in the .cpp file.
Definition at line 31 of file TRUSTTravPool.h.
| using TRUSTTravPool< _TYPE_ >::block_ptr_t = std::shared_ptr<std::vector<_TYPE_, TVAlloc<_TYPE_> > > |
Definition at line 34 of file TRUSTTravPool.h.
|
delete |
|
static |
Empty the TRUSTTrav pool explicitely.
Definition at line 242 of file TRUSTTravPool.cpp.
|
static |
|
static |
Retrieve a free block of size sz.
This takes the last available block from the list of the corresponding size, or returns a newly allocated block if none is available in the block.
| sz | the number of elements in the requested block |
Definition at line 119 of file TRUSTTravPool.cpp.
|
static |
Debug method printing useful stats.
Definition at line 268 of file TRUSTTravPool.cpp.
|
static |
Release a block.
This is invoked from the dtor of TRUSTArray and makes the memory block available again by registering it in the pool of free blocks. We don't register blocks of size 0.
| p | the shared pointer to the block to release back to the pool |
Definition at line 207 of file TRUSTTravPool.cpp.
|
static |
"Resize" a temporary Trav block - two possible strategies: Strategy 1
| p | shared pointer to the current block to resize |
| new_sz | the new number of elements |
Definition at line 170 of file TRUSTTravPool.cpp.