Open CASCADE Technology 6.6.0
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.
 ~CollectBySize ()
 Destructor.
void Reset ()
 Reset the buffer and start collecting events.
Standard_Boolean MakeReport (const char *theOutFile)
 Write report in the given file.
virtual void AllocEvent (size_t, long)
 Allocation event handler.
virtual void FreeEvent (void *, size_t, long)
 Freeing event handler.

Data Fields

Standard_Mutex myMutex
 used for thread-safe access
NumbersmyArray
 indexed from 0 to myMaxAllocSize-1
ptrdiff_t myTotalLeftSize
 currently remained allocated size
size_t myTotalPeakSize
 maxium cumulative allocated size
size_t myBreakSize

Static Public Attributes

static const size_t myMaxAllocSize
 maximum tracked size

Detailed Description

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


Constructor & Destructor Documentation

OSD_MAllocHook::CollectBySize::CollectBySize ( )
OSD_MAllocHook::CollectBySize::~CollectBySize ( )

Member Function Documentation

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

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.

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

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.

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

Field Documentation


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines