Open CASCADE Technology  7.7.0
Static Public Member Functions

Standard Class Reference

The package Standard provides global memory allocator and other basic services used by other OCCT components. More...

#include <Standard.hxx>

Static Public Member Functions

static Standard_Address Allocate (const Standard_Size aSize)
 Allocates memory blocks aSize - bytes to allocate. More...
 
static void Free (const Standard_Address thePtr)
 Deallocates memory blocks. More...
 
template<typename T >
static void Free (T *&thePtr)
 Template version of function Free(), nullifies the argument pointer. More...
 
static Standard_Address Reallocate (const Standard_Address aStorage, const Standard_Size aNewSize)
 Reallocates memory blocks aStorage - previously allocated memory block aNewSize - new size in bytes. More...
 
static Standard_Address AllocateAligned (const Standard_Size theSize, const Standard_Size theAlign)
 Allocates aligned memory blocks. Should be used with CPU instructions which require specific alignment. For example: SSE requires 16 bytes, AVX requires 32 bytes. More...
 
static void FreeAligned (const Standard_Address thePtrAligned)
 Deallocates memory blocks. More...
 
template<typename T >
static void FreeAligned (T *&thePtrAligned)
 Template version of function FreeAligned(), nullifies the argument pointer. More...
 
static Standard_Integer Purge ()
 Deallocates the storage retained on the free list and clears the list. Returns non-zero if some memory has been actually freed. More...
 
static Standard_Boolean StackTrace (char *theBuffer, const int theBufferSize, const int theNbTraces, void *theContext=NULL, const int theNbTopSkip=0)
 Appends backtrace to a message buffer. Stack information might be incomplete in case of stripped binaries. Implementation details: More...
 

Detailed Description

The package Standard provides global memory allocator and other basic services used by other OCCT components.

Member Function Documentation

◆ Allocate()

static Standard_Address Standard::Allocate ( const Standard_Size  aSize)
static

Allocates memory blocks aSize - bytes to allocate.

◆ AllocateAligned()

static Standard_Address Standard::AllocateAligned ( const Standard_Size  theSize,
const Standard_Size  theAlign 
)
static

Allocates aligned memory blocks. Should be used with CPU instructions which require specific alignment. For example: SSE requires 16 bytes, AVX requires 32 bytes.

Parameters
theSizebytes to allocate
theAlignalignment in bytes

◆ Free() [1/2]

static void Standard::Free ( const Standard_Address  thePtr)
static

Deallocates memory blocks.

Parameters
thePtr- previously allocated memory block to be freed

◆ Free() [2/2]

template<typename T >
static void Standard::Free ( T *&  thePtr)
inlinestatic

Template version of function Free(), nullifies the argument pointer.

Parameters
thePtr- previously allocated memory block to be freed

◆ FreeAligned() [1/2]

static void Standard::FreeAligned ( const Standard_Address  thePtrAligned)
static

Deallocates memory blocks.

Parameters
thePtrAlignedthe memory block previously allocated with AllocateAligned()

◆ FreeAligned() [2/2]

template<typename T >
static void Standard::FreeAligned ( T *&  thePtrAligned)
inlinestatic

Template version of function FreeAligned(), nullifies the argument pointer.

Parameters
thePtrAlignedthe memory block previously allocated with AllocateAligned()

◆ Purge()

static Standard_Integer Standard::Purge ( )
static

Deallocates the storage retained on the free list and clears the list. Returns non-zero if some memory has been actually freed.

◆ Reallocate()

static Standard_Address Standard::Reallocate ( const Standard_Address  aStorage,
const Standard_Size  aNewSize 
)
static

Reallocates memory blocks aStorage - previously allocated memory block aNewSize - new size in bytes.

◆ StackTrace()

static Standard_Boolean Standard::StackTrace ( char *  theBuffer,
const int  theBufferSize,
const int  theNbTraces,
void *  theContext = NULL,
const int  theNbTopSkip = 0 
)
static

Appends backtrace to a message buffer. Stack information might be incomplete in case of stripped binaries. Implementation details:

  • Not implemented for Android, iOS, QNX and UWP platforms.
  • On non-Windows platform, this function is a wrapper to backtrace() system call.
  • On Windows (Win32) platform, the function loads DbgHelp.dll dynamically, and no stack will be provided if this or companion libraries (SymSrv.dll, SrcSrv.dll, etc.) will not be found; .pdb symbols should be provided on Windows platform to retrieve a meaningful stack; only x86_64 CPU architecture is currently implemented.
    Parameters
    theBuffer[in] [out] message buffer to extend
    theBufferSize[in] message buffer size
    theNbTraces[in] maximum number of stack traces
    theContext[in] optional platform-dependent frame context; in case of DbgHelp (Windows) should be a pointer to CONTEXT
    theNbTopSkip[in] number of traces on top of the stack to skip
    Returns
    TRUE on success

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