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 <hist_util.h>

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

Public Member Functions

 MemStackAllocator (size_t required_size)
 
T * Get ()
 
 ~MemStackAllocator ()
 

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()

template<typename T , size_t MaxStackSize>
xgboost::common::MemStackAllocator< T, MaxStackSize >::MemStackAllocator ( size_t  required_size)
inlineexplicit

◆ ~MemStackAllocator()

template<typename T , size_t MaxStackSize>
xgboost::common::MemStackAllocator< T, MaxStackSize >::~MemStackAllocator ( )
inline

Member Function Documentation

◆ Get()

template<typename T , size_t MaxStackSize>
T* xgboost::common::MemStackAllocator< T, MaxStackSize >::Get ( )
inline

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