SIRIUS 7.5.0
Electronic structure library and applications
memory.cpp
1#include "memory.hpp"
2
3namespace sirius {
4
5namespace sddk {
6
7/// Return a memory pool.
8/** A memory pool is created when this function called for the first time. */
9sddk::memory_pool&
10get_memory_pool(sddk::memory_t M__)
11{
12 static std::map<sddk::memory_t, sddk::memory_pool> memory_pool_;
13 if (memory_pool_.count(M__) == 0) {
14 memory_pool_.emplace(M__, sddk::memory_pool(M__));
15 }
16 return memory_pool_.at(M__);
17}
18
19} // namespace sddk
20
21} // namespace sirius
Memory management functions and classes.
Namespace of the SIRIUS library.
Definition: sirius.f90:5