|
tatami_chunked
Helpers to create custom chunked tatami matrices
|
Factory for dense slabs. More...
#include <DenseSlabFactory.hpp>
Classes | |
| struct | Slab |
| Dense slab. More... | |
Public Member Functions | |
| template<typename Index_ > | |
| DenseSlabFactory (std::size_t slab_size, Index_ max_slabs) | |
| template<typename Index_ > | |
| DenseSlabFactory (const SlabCacheStats< Index_ > &stats) | |
| Slab | create () |
Factory for dense slabs.
An instance of this class allocates a single memory pool during its construction. Each slab is simply a pointer into this pool at regular offsets. The idea is to allocate one large block for caching in, e.g., LruSlabCache, improving performance by avoiding repeated requests to the allocator. This also reduces fragmentation that could increase memory usage beyond the expected cache size.
| Value_ | Type of the data in each slab. |
|
inline |
| Index_ | Integer type of the maximum number of slabs, see the template parameter of the same name in SlabCacheStats. |
| slab_size | Size of the slab, in terms of data elements. |
| max_slabs | Maximum number of slabs. |
|
inline |
| Index_ | Integer type of the dimension extent. |
| stats | Slab cache statistics. |
|
inline |
Create a new slab, i.e., designate a portion of the memory pool for use through the returned pointer. This should not be called more than max_slabs times.