DDNet documentation
Loading...
Searching...
No Matches
CHeap Class Reference

#include <memheap.h>

Collaboration diagram for CHeap:
[legend]

Classes

struct  CChunk

Public Member Functions

 CHeap ()
 ~CHeap ()
void Reset ()
void * Allocate (size_t Size, size_t Alignment=alignof(std::max_align_t))
const char * StoreString (const char *pSrc)
template<typename T, typename... TArgs>
T * Allocate (TArgs &&...Args)

Private Member Functions

void Clear ()
void NewChunk (size_t ChunkSize)
void * AllocateFromChunk (size_t Size, size_t Alignment)

Private Attributes

CChunkm_pCurrent

Static Private Attributes

static constexpr size_t CHUNK_SIZE = 1025 * 64

Constructor & Destructor Documentation

◆ CHeap()

CHeap::CHeap ( )

◆ ~CHeap()

CHeap::~CHeap ( )

Member Function Documentation

◆ Allocate() [1/2]

void * CHeap::Allocate ( size_t Size,
size_t Alignment = alignof(std::max_align_t) )

◆ Allocate() [2/2]

template<typename T, typename... TArgs>
T * CHeap::Allocate ( TArgs &&... Args)
inline

◆ AllocateFromChunk()

void * CHeap::AllocateFromChunk ( size_t Size,
size_t Alignment )
private

◆ Clear()

void CHeap::Clear ( )
private

◆ NewChunk()

void CHeap::NewChunk ( size_t ChunkSize)
private

◆ Reset()

void CHeap::Reset ( )

◆ StoreString()

const char * CHeap::StoreString ( const char * pSrc)

Member Data Documentation

◆ CHUNK_SIZE

size_t CHeap::CHUNK_SIZE = 1025 * 64
staticconstexprprivate

How large each chunk should be.

◆ m_pCurrent

CChunk* CHeap::m_pCurrent
private

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