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>

Collaboration diagram for GblAllocationTracker:

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

GblAllocationTrackerGblAllocationTracker_create (GblContext *pCtx)
 
GBL_RESULT GblAllocationTracker_destroy (GblAllocationTracker *pSelf)
 
Allocation Events

Methods for capturing allocation events

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

General and other methods

GblBool GblAllocationTracker_validatePointer (const GblAllocationTracker *pSelf, const void *pPtr)
 
GBL_RESULT GblAllocationTracker_logActive (const GblAllocationTracker *pSelf)
 
Counter Operations

Methods involving GblAllocationCountes

void GblAllocationTracker_captureCounters (const GblAllocationTracker *pSelf, GblAllocationCounters *pCount)
 
void GblAllocationTracker_diffCounters (const GblAllocationTracker *pSelf, const GblAllocationCounters *pSrc, GblAllocationCounters *pDst)
 

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

GblAllocationTracker * GblAllocationTracker_create ( GblContext * pCtx)
related

Creates a GblAllocationTracker and returns a pointer to it.

◆ GblAllocationTracker_destroy()

GBL_RESULT GblAllocationTracker_destroy ( GblAllocationTracker * pSelf)
related

Destroys the given GblAllocation tracker, returning the result.

◆ GblAllocationTracker_allocEvent()

GBL_RESULT GblAllocationTracker_allocEvent ( GblAllocationTracker * pSelf,
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_RESULT GblAllocationTracker_reallocEvent ( GblAllocationTracker * pSelf,
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_RESULT GblAllocationTracker_freeEvent ( GblAllocationTracker * pSelf,
const void * pPtr,
GblSourceLocation srcLoc )
related

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

◆ GblAllocationTracker_validatePointer()

GblBool GblAllocationTracker_validatePointer ( const GblAllocationTracker * pSelf,
const void * pPtr )
related

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

◆ GblAllocationTracker_logActive()

GBL_RESULT GblAllocationTracker_logActive ( const GblAllocationTracker * pSelf)
related

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

◆ GblAllocationTracker_captureCounters()

void GblAllocationTracker_captureCounters ( const GblAllocationTracker * pSelf,
GblAllocationCounters * pCount )
related

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

◆ GblAllocationTracker_diffCounters()

void GblAllocationTracker_diffCounters ( const GblAllocationTracker * pSelf,
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: