libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
GblAllocationTracker Struct Reference

#include <gimbal_allocation_tracker.h>

Data Fields

size_t maxAllocations
 
size_t maxBytes
 
size_t maxAllocationSize
 
GblAllocationCounters counters
 

Related Symbols

(Note that these are not member symbols.)

Lifetime Management

Methods for creating and destroying

GBL_EXPORT GblAllocationTrackerGblAllocationTracker_create (GblContext *pCtx) GBL_NOEXCEPT
 
GBL_EXPORT GBL_RESULT GblAllocationTracker_destroy (GBL_SELF) GBL_NOEXCEPT
 
Allocation Events

Methods for capturing allocation events

GBL_EXPORT GBL_RESULT GblAllocationTracker_allocEvent (GBL_SELF, const void *pPtr, size_t size, size_t align, const char *pDbg, GblSourceLocation srcLoc) GBL_NOEXCEPT
 
GBL_EXPORT GBL_RESULT GblAllocationTracker_reallocEvent (GBL_SELF, const void *pExisting, const void *pNew, size_t newSize, size_t newAlign, GblSourceLocation srcLoc) GBL_NOEXCEPT
 
GBL_EXPORT GBL_RESULT GblAllocationTracker_freeEvent (GBL_SELF, const void *pPtr, GblSourceLocation srcLoc) GBL_NOEXCEPT
 
Utilities

General and other methods

GBL_EXPORT GblBool GblAllocationTracker_validatePointer (GBL_CSELF, const void *pPtr) GBL_NOEXCEPT
 
GBL_EXPORT GBL_RESULT GblAllocationTracker_logActive (GBL_CSELF) GBL_NOEXCEPT
 
Counter Operations

Methods involving GblAllocationCountes

GBL_EXPORT void GblAllocationTracker_captureCounters (GBL_CSELF, GblAllocationCounters *pCount) GBL_NOEXCEPT
 
GBL_EXPORT void GblAllocationTracker_diffCounters (GBL_CSELF, const GblAllocationCounters *pSrc, GblAllocationCounters *pDst) GBL_NOEXCEPT
 

Detailed Description

Structure used for tracking allocation events and statistics.

Definition at line 31 of file gimbal_allocation_tracker.h.

Friends And Related Symbol Documentation

◆ GblAllocationTracker_create()

GBL_EXPORT GblAllocationTracker * GblAllocationTracker_create ( GblContext pCtx)
related

Creates a GblAllocationTracker and returns a pointer to it.

◆ GblAllocationTracker_destroy()

GBL_EXPORT GBL_RESULT GblAllocationTracker_destroy ( GBL_SELF  )
related

Destroys the given GblAllocation tracker, returning the result.

◆ GblAllocationTracker_allocEvent()

GBL_EXPORT GBL_RESULT GblAllocationTracker_allocEvent ( GBL_SELF  ,
const void *  pPtr,
size_t  size,
size_t  align,
const char *  pDbg,
GblSourceLocation  srcLoc 
)
related

To be called every time an allocation has been requested, to track the event.

◆ GblAllocationTracker_reallocEvent()

GBL_EXPORT GBL_RESULT GblAllocationTracker_reallocEvent ( GBL_SELF  ,
const void *  pExisting,
const void *  pNew,
size_t  newSize,
size_t  newAlign,
GblSourceLocation  srcLoc 
)
related

To be called every time a reallocation has been requested, to track the event.

◆ GblAllocationTracker_freeEvent()

GBL_EXPORT GBL_RESULT GblAllocationTracker_freeEvent ( GBL_SELF  ,
const void *  pPtr,
GblSourceLocation  srcLoc 
)
related

To be called every time a free has been requested, to track the event.

◆ GblAllocationTracker_validatePointer()

GBL_EXPORT GblBool GblAllocationTracker_validatePointer ( GBL_CSELF  ,
const void *  pPtr 
)
related

Returns GBL_TRUE if the given pointer points to an active, tracked allocation.

◆ GblAllocationTracker_logActive()

GBL_EXPORT GBL_RESULT GblAllocationTracker_logActive ( GBL_CSELF  )
related

Dumps all of the active allocations and their context information to the log.

◆ GblAllocationTracker_captureCounters()

GBL_EXPORT void GblAllocationTracker_captureCounters ( GBL_CSELF  ,
GblAllocationCounters pCount 
)
related

Saves the current value of GblAllocationTracker::counters to the given structure.

◆ GblAllocationTracker_diffCounters()

GBL_EXPORT void GblAllocationTracker_diffCounters ( GBL_CSELF  ,
const GblAllocationCounters pSrc,
GblAllocationCounters pDst 
)
related

Takes the difference between GblAllocationTracker::counters and pSrc, storing the result in the pDst.

Field Documentation

◆ maxAllocations

size_t GblAllocationTracker::maxAllocations

Maximum number of active allocations.

Definition at line 32 of file gimbal_allocation_tracker.h.

◆ maxBytes

size_t GblAllocationTracker::maxBytes

Maximum number of allocated bytes.

Definition at line 33 of file gimbal_allocation_tracker.h.

◆ maxAllocationSize

size_t GblAllocationTracker::maxAllocationSize

Maximum size of a single allocation.

Definition at line 34 of file gimbal_allocation_tracker.h.

◆ counters

GblAllocationCounters GblAllocationTracker::counters

Current allocation counters.

Definition at line 35 of file gimbal_allocation_tracker.h.


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