Open CASCADE Technology  7.2.0
Data Structures | Static Public Member Functions

OSD_MAllocHook Class Reference

#include <OSD_MAllocHook.hxx>

Data Structures

class  Callback
 
class  CollectBySize
 
class  LogFileHandler
 

Static Public Member Functions

static void SetCallback (Callback *theCB)
 Set handler of allocation/deallocation events. More...
 
static CallbackGetCallback ()
 Get current handler of allocation/deallocation events. More...
 
static LogFileHandlerGetLogFileHandler ()
 Get static instance of LogFileHandler handler. More...
 
static CollectBySizeGetCollectBySize ()
 Get static instance of CollectBySize handler. More...
 

Detailed Description

This class provides the possibility to set callback for memory allocation/deallocation. On MS Windows, it works only in Debug builds. It relies on the debug CRT function _CrtSetAllocHook (see MSDN for help).

Member Function Documentation

◆ GetCallback()

static Callback* OSD_MAllocHook::GetCallback ( )
static

Get current handler of allocation/deallocation events.

◆ GetCollectBySize()

static CollectBySize* OSD_MAllocHook::GetCollectBySize ( )
static

Get static instance of CollectBySize handler.

◆ GetLogFileHandler()

static LogFileHandler* OSD_MAllocHook::GetLogFileHandler ( )
static

Get static instance of LogFileHandler handler.

◆ SetCallback()

static void OSD_MAllocHook::SetCallback ( Callback theCB)
static

Set handler of allocation/deallocation events.

You can pass here any implementation. For easy start, you can try with the predefined handler LogFileHandler, which static instance is returned by GetLogFileHandler(). To clear the handler, pass NULL here.


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