#include <tbox/Allocator.h>
|
| template<typename TYPE > |
| TYPE * | allocate (const std::size_t block_size) |
| |
Internal allocation class. Responsible for managing a memory pool for all Array instances.
◆ Allocator() [1/2]
| SAMRAI::tbox::Allocator::Allocator |
( |
| ) |
|
|
private |
Constructor. As there is only one Allocator at a time this is private.
◆ Allocator() [2/2]
| SAMRAI::tbox::Allocator::Allocator |
( |
const Allocator & |
| ) |
|
|
privatedelete |
◆ ~Allocator()
| SAMRAI::tbox::Allocator::~Allocator |
( |
| ) |
|
|
private |
◆ getAllocator()
| static Allocator& SAMRAI::tbox::Allocator::getAllocator |
( |
| ) |
|
|
static |
◆ operator=()
◆ count()
template<typename TYPE >
| static std::size_t& SAMRAI::tbox::Allocator::count |
( |
| ) |
|
|
inlinestaticprivate |
◆ internal_allocate()
| static std::pair<bool, void *> SAMRAI::tbox::Allocator::internal_allocate |
( |
std::size_t |
n_bytes | ) |
|
|
staticprivate |
Internal allocation function.
- Returns
- A pair whose first value indicates whether or not the memory was allocated (i.e.,
true for a new allocation, false for reusing an existing allocation), and whose second value is a pointer to at least n_bytes of storage.
◆ internal_deallocate()
| static void SAMRAI::tbox::Allocator::internal_deallocate |
( |
void * |
buffer, |
|
|
std::size_t |
n_bytes |
|
) |
| |
|
staticprivate |
Internal deallocation function.
The second size must be the same as the value provided to internal_allocate().
◆ getNumberOfAllocations()
template<typename TYPE >
| static std::size_t SAMRAI::tbox::Allocator::getNumberOfAllocations |
( |
| ) |
|
|
inlinestatic |
◆ allocate()
template<typename TYPE >
| TYPE* SAMRAI::tbox::Allocator::allocate |
( |
const std::size_t |
block_size | ) |
|
|
inline |
Return a block of memory with enough space for block_size elements of type TYPE. This block may either be newly allocated (via std::malloc()) or taken from a pool of previously allocated data.
This function is not static to ensure it is only called after Allocator() called.
◆ deallocate()
template<typename TYPE >
| static void SAMRAI::tbox::Allocator::deallocate |
( |
TYPE *const |
block, |
|
|
const std::size_t |
block_size |
|
) |
| |
|
inlinestatic |
Return an allocated block to the allocator.
This function is static since it may be run after ~Allocator() is run.
The documentation for this class was generated from the following file: