timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::data::shared_stateful_allocator< AllocT > Class Template Reference

Ensures that allocators which have state are not deleted until all handles to the allocator have been released. More...

#include "timemory/data/shared_stateful_allocator.hpp"

+ Collaboration diagram for tim::data::shared_stateful_allocator< AllocT >:

Public Types

using this_type = shared_stateful_allocator< AllocT >
 

Static Public Member Functions

static auto request ()
 
static auto release (std::shared_ptr< AllocT > &_v)
 

Detailed Description

template<typename AllocT>
class tim::data::shared_stateful_allocator< AllocT >

Ensures that allocators which have state are not deleted until all handles to the allocator have been released.

Template Parameters
AllocTThe allocator type

Definition at line 49 of file shared_stateful_allocator.hpp.

Member Typedef Documentation

◆ this_type

Definition at line 51 of file shared_stateful_allocator.hpp.

Member Function Documentation

◆ release()

template<typename AllocT >
static auto tim::data::shared_stateful_allocator< AllocT >::release ( std::shared_ptr< AllocT > &  _v)
inlinestatic

Definition at line 62 of file shared_stateful_allocator.hpp.

63 {
64 auto_lock_t _lk{ type_mutex<this_type>() };
65 return instance().release_impl(_v);
66 }
std::unique_lock< mutex_t > auto_lock_t
Unique lock type around mutex_t.
Definition: locking.hpp:42

Referenced by tim::graph< T, AllocatorT >::~graph().

◆ request()

template<typename AllocT >
static auto tim::data::shared_stateful_allocator< AllocT >::request ( )
inlinestatic

Definition at line 54 of file shared_stateful_allocator.hpp.

55 {
56 auto_lock_t _lk{ type_mutex<this_type>() };
57 return instance().request_impl();
58 }

The documentation for this class was generated from the following file: