Open CASCADE Technology  7.7.0.dev
Data Structures | Public Member Functions | Data Fields | Static Public Attributes

OSD_MAllocHook::CollectBySize Class Reference

#include <OSD_MAllocHook.hxx>

Inheritance diagram for OSD_MAllocHook::CollectBySize:
Inheritance graph
[legend]

Data Structures

struct  Numbers
 

Public Member Functions

 CollectBySize ()
 Constructor. More...
 
 ~CollectBySize ()
 Destructor. More...
 
void Reset ()
 Reset the buffer and start collecting events. More...
 
Standard_Boolean MakeReport (const char *theOutFile)
 Write report in the given file. More...
 
virtual void AllocEvent (size_t, long)
 Allocation event handler. More...
 
virtual void FreeEvent (void *, size_t, long)
 Freeing event handler. More...
 

Data Fields

Standard_Mutex myMutex
 used for thread-safe access More...
 
NumbersmyArray
 indexed from 0 to myMaxAllocSize-1 More...
 
ptrdiff_t myTotalLeftSize
 currently remained allocated size More...
 
size_t myTotalPeakSize
 maximum cumulative allocated size More...
 
size_t myBreakSize
 user defined allocation size to debug (see place_for_breakpoint()) More...
 
size_t myBreakPeak
 user defined peak size limit to debug More...
 

Static Public Attributes

static const size_t myMaxAllocSize
 maximum tracked size More...
 

Detailed Description

Implementation of the handler that collects numbers of allocations/deallocations for each block size directly in the memory.

Constructor & Destructor Documentation

◆ CollectBySize()

OSD_MAllocHook::CollectBySize::CollectBySize ( )

Constructor.

◆ ~CollectBySize()

OSD_MAllocHook::CollectBySize::~CollectBySize ( )

Destructor.

Member Function Documentation

◆ AllocEvent()

virtual void OSD_MAllocHook::CollectBySize::AllocEvent ( size_t  theSize,
long  theRequestNum 
)
virtual

Allocation event handler.

It is called when allocation is done

Parameters
theSizethe size of the memory block in bytes
theRequestNumthe allocation order number of the memory block

Implements OSD_MAllocHook::Callback.

◆ FreeEvent()

virtual void OSD_MAllocHook::CollectBySize::FreeEvent ( void *  theData,
size_t  theSize,
long  theRequestNum 
)
virtual

Freeing event handler.

It is called when the block is freed

Parameters
theDatathe pointer to the user data section of the memory block
theSizethe size of the memory block in bytes
theRequestNumthe allocation order number of the memory block

Implements OSD_MAllocHook::Callback.

◆ MakeReport()

Standard_Boolean OSD_MAllocHook::CollectBySize::MakeReport ( const char *  theOutFile)

Write report in the given file.

◆ Reset()

void OSD_MAllocHook::CollectBySize::Reset ( )

Reset the buffer and start collecting events.

Field Documentation

◆ myArray

Numbers* OSD_MAllocHook::CollectBySize::myArray

indexed from 0 to myMaxAllocSize-1

◆ myBreakPeak

size_t OSD_MAllocHook::CollectBySize::myBreakPeak

user defined peak size limit to debug

◆ myBreakSize

size_t OSD_MAllocHook::CollectBySize::myBreakSize

user defined allocation size to debug (see place_for_breakpoint())

◆ myMaxAllocSize

const size_t OSD_MAllocHook::CollectBySize::myMaxAllocSize
static

maximum tracked size

◆ myMutex

Standard_Mutex OSD_MAllocHook::CollectBySize::myMutex

used for thread-safe access

◆ myTotalLeftSize

ptrdiff_t OSD_MAllocHook::CollectBySize::myTotalLeftSize

currently remained allocated size

◆ myTotalPeakSize

size_t OSD_MAllocHook::CollectBySize::myTotalPeakSize

maximum cumulative allocated size


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