Open CASCADE Technology 7.8.2.dev
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.
 
static CallbackGetCallback ()
 Get current handler of allocation/deallocation events.
 
static LogFileHandlerGetLogFileHandler ()
 Get static instance of LogFileHandler handler.
 
static CollectBySizeGetCollectBySize ()
 Get static instance of CollectBySize handler.
 

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: