kokkos-execution 0.0.1
Loading...
Searching...
No Matches
Tests::Utils::TrackingAllocator< T > Struct Template Reference

A minimal tracking allocator. More...

#include <tracking_allocator.hpp>

Public Types

using value_type = T

Public Member Functions

T * allocate (std::size_t n)
void deallocate (T *ptr, std::size_t size)

Public Attributes

std::atomic< size_t > * count

Friends

constexpr auto operator<=> (const TrackingAllocator &, const TrackingAllocator &) noexcept=default

Detailed Description

template<typename T>
struct Tests::Utils::TrackingAllocator< T >

A minimal tracking allocator.

It atomically counts allocations.

Definition at line 16 of file tracking_allocator.hpp.

Member Typedef Documentation

◆ value_type

template<typename T>
using Tests::Utils::TrackingAllocator< T >::value_type = T

Definition at line 17 of file tracking_allocator.hpp.

Member Function Documentation

◆ allocate()

template<typename T>
T * Tests::Utils::TrackingAllocator< T >::allocate ( std::size_t n)
inline

Definition at line 21 of file tracking_allocator.hpp.

◆ deallocate()

template<typename T>
void Tests::Utils::TrackingAllocator< T >::deallocate ( T * ptr,
std::size_t size )
inline

Definition at line 26 of file tracking_allocator.hpp.

◆ operator<=>

template<typename T>
auto operator<=> ( const TrackingAllocator< T > & ,
const TrackingAllocator< T > &  )
friend

Member Data Documentation

◆ count

template<typename T>
std::atomic<size_t>* Tests::Utils::TrackingAllocator< T >::count

Definition at line 19 of file tracking_allocator.hpp.


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