dispenso
A library for task parallelism
 
Loading...
Searching...
No Matches
dispenso::DefaultConcurrentVectorSizeTraits< T > Struct Template Reference

#include <concurrent_vector.h>

Static Public Attributes

static constexpr size_t kDefaultCapacity = (sizeof(T) >= 256) ? 2 : 512 / sizeof(T)
 This is the starting user-expected capacity in number of elements (algorithm may provide more based on kReallocStrategy)
 
static constexpr size_t kMaxVectorSize
 The maximum possible size for the vector.
 

Detailed Description

template<typename T>
struct dispenso::DefaultConcurrentVectorSizeTraits< T >

The default ConcurrentVector traits type for defining capacities and max capacities. Both members are required should one wish to supply a custom set of traits.

Definition at line 90 of file concurrent_vector.h.

Member Data Documentation

◆ kDefaultCapacity

template<typename T >
constexpr size_t dispenso::DefaultConcurrentVectorSizeTraits< T >::kDefaultCapacity = (sizeof(T) >= 256) ? 2 : 512 / sizeof(T)
staticconstexpr

This is the starting user-expected capacity in number of elements (algorithm may provide more based on kReallocStrategy)

Definition at line 95 of file concurrent_vector.h.

◆ kMaxVectorSize

template<typename T >
constexpr size_t dispenso::DefaultConcurrentVectorSizeTraits< T >::kMaxVectorSize
staticconstexpr
Initial value:
=
(size_t{1} << (sizeof(size_t) * CHAR_BIT > 47 ? 47 : sizeof(size_t) * CHAR_BIT - 1)) /
detail::OpResult< T > OpResult
Definition pipeline.h:29

The maximum possible size for the vector.

The reason this exists is because if someone doesn't require vectors of length in e.g. petabytes, the class can use less space. Additionally, some minor optimizations may be possible if the max size is less than 32-bits.

Definition at line 104 of file concurrent_vector.h.


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