xgboost

Public Member Functions | List of all members
xgboost::common::MemStackAllocator< T, MaxStackSize > Class Template Reference

A C-style array with in-stack allocation. As long as the array is smaller than MaxStackSize, it will be allocated inside the stack. Otherwise, it will be heap-allocated. More...

`#include <threading_utils.h>`

Collaboration diagram for xgboost::common::MemStackAllocator< T, MaxStackSize >:

## Public Member Functions
| MemStackAllocator (size_t required_size)
| MemStackAllocator (size_t required_size, T init)
| ~MemStackAllocator ()
T & | operator[] (size_t i)
T const & | operator[] (size_t i) const

## Detailed Description

### template<typename T, size_t MaxStackSize>
class xgboost::common::MemStackAllocator< T, MaxStackSize >

A C-style array with in-stack allocation. As long as the array is smaller than MaxStackSize, it will be allocated inside the stack. Otherwise, it will be heap-allocated.

## Constructor & Destructor Documentation

## ◆ MemStackAllocator() [1/2]

template<typename T , size_t MaxStackSize>

xgboost::common::MemStackAllocator< T, MaxStackSize >::MemStackAllocator | ( | size_t | required_size | ) |
| inline explicit

## ◆ MemStackAllocator() [2/2]

template<typename T , size_t MaxStackSize>

xgboost::common::MemStackAllocator< T, MaxStackSize >::MemStackAllocator | ( | size_t | required_size,
|  | T | init
| ) |  |
| inline

## ◆ ~MemStackAllocator()

template<typename T , size_t MaxStackSize>

xgboost::common::MemStackAllocator< T, MaxStackSize >::~MemStackAllocator | ( |  | ) |
| inline

## Member Function Documentation

## ◆ operator[]() [1/2]

template<typename T , size_t MaxStackSize>

T& xgboost::common::MemStackAllocator< T, MaxStackSize >::operator[] | ( | size_t | i | ) |
| inline

## ◆ operator[]() [2/2]

template<typename T , size_t MaxStackSize>

T const& xgboost::common::MemStackAllocator< T, MaxStackSize >::operator[] | ( | size_t | i | ) | const
| inline

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

- /home/runner/work/xgboost/xgboost/src/common/threading_utils.h