DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Deki::AllocContext Struct Reference

Who asked for an allocation, filled in by the compiler. More...

#include <deki/providers/Memory.h>

Public Member Functions

 AllocContext (std::source_location loc=std::source_location::current())
const char * File () const
const char * Name () const
uint32_t Line () const

Public Attributes

const char * file
 FILE of the call site
const char * function
 enclosing function, with its signature on GCC
uint32_t line

Detailed Description

Who asked for an allocation, filled in by the compiler.

Nobody writes one. Every allocating call takes an AllocContext whose default argument captures the call site, so an allocation is identified by where it was written:

Deki::Memory::Allocate(n, Deki::Memory::Internal);
// -> 'void ParticlePool::SetCapacity(size_t)' at ParticlePool.h:47

Nothing is copied or allocated: every member points at a string literal with static storage, so the debug leak table can keep the pointer.

Constructor & Destructor Documentation

◆ AllocContext()

Deki::AllocContext::AllocContext ( std::source_location loc = std::source_location::current())
inline

Member Function Documentation

◆ File()

const char * Deki::AllocContext::File ( ) const
inline

◆ Name()

const char * Deki::AllocContext::Name ( ) const
inline

◆ Line()

uint32_t Deki::AllocContext::Line ( ) const
inline

Member Data Documentation

◆ file

const char* Deki::AllocContext::file

FILE of the call site

◆ function

const char* Deki::AllocContext::function

enclosing function, with its signature on GCC

◆ line

uint32_t Deki::AllocContext::line

The documentation for this struct was generated from the following file:
  • deki-engine/include/deki/providers/Memory.h