OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    Standard Class Reference

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

    #include <Standard.hxx>

    Public Types

    enum class  AllocatorType { NATIVE = 0 , OPT = 1 , TBB = 2 , JEMALLOC = 3 }
     Enumiration of possible allocator types. More...

    Static Public Member Functions

    static AllocatorType GetAllocatorType ()
     Returns default allocator type.
    static void * Allocate (const size_t theSize)
     Allocates memory blocks theSize - bytes to allocate.
    static void * AllocateOptimal (const size_t theSize)
     Allocates memory blocks theSize - bytes to allocate.
    static void Free (void *const thePtr)
     Deallocates memory blocks.
    template<typename T>
    static void Free (T *&thePtr)
     Template version of function Free(), nullifies the argument pointer.
    static void * Reallocate (void *const theStorage, const size_t theNewSize)
     Reallocates memory blocks theStorage - previously allocated memory block theNewSize - new size in bytes.
    static void * AllocateAligned (const size_t theSize, const size_t 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.
    static void FreeAligned (void *const thePtrAligned)
     Deallocates memory blocks.
    template<typename T>
    static void FreeAligned (T *&thePtrAligned)
     Template version of function FreeAligned(), nullifies the argument pointer.
    static int Purge ()
     Deallocates the storage retained on the free list and clears the list. Returns non-zero if some memory has been actually freed.
    static bool StackTrace (char *theBuffer, const int theBufferSize, const int theNbTraces, void *theContext=nullptr, const int theNbTopSkip=0)
     Appends backtrace to a message buffer. Stack information might be incomplete in case of stripped binaries. Implementation details:

    Detailed Description

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

    Member Enumeration Documentation

    ◆ AllocatorType

    enum class Standard::AllocatorType
    strong

    Enumiration of possible allocator types.

    Enumerator
    NATIVE 
    OPT 
    TBB 
    JEMALLOC 

    Member Function Documentation

    ◆ Allocate()

    void * Standard::Allocate ( const size_t theSize)
    static

    Allocates memory blocks theSize - bytes to allocate.

    ◆ AllocateAligned()

    void * Standard::AllocateAligned ( const size_t theSize,
    const size_t 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

    ◆ AllocateOptimal()

    void * Standard::AllocateOptimal ( const size_t theSize)
    static

    Allocates memory blocks theSize - bytes to allocate.

    ◆ Free() [1/2]

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

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

    Parameters
    thePtr- previously allocated memory block to be freed

    ◆ Free() [2/2]

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

    Deallocates memory blocks.

    Parameters
    thePtr- previously allocated memory block to be freed

    ◆ FreeAligned() [1/2]

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

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

    Parameters
    thePtrAlignedthe memory block previously allocated with AllocateAligned()

    ◆ FreeAligned() [2/2]

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

    Deallocates memory blocks.

    Parameters
    thePtrAlignedthe memory block previously allocated with AllocateAligned()

    ◆ GetAllocatorType()

    AllocatorType Standard::GetAllocatorType ( )
    static

    Returns default allocator type.

    ◆ Purge()

    int 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()

    void * Standard::Reallocate ( void *const theStorage,
    const size_t theNewSize )
    static

    Reallocates memory blocks theStorage - previously allocated memory block theNewSize - new size in bytes.

    ◆ StackTrace()

    bool Standard::StackTrace ( char * theBuffer,
    const int theBufferSize,
    const int theNbTraces,
    void * theContext = nullptr,
    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
      [in]
      out] theBuffer message buffer to extend
      Parameters
      [in]theBufferSizemessage buffer size
      [in]theNbTracesmaximum number of stack traces
      [in]theContextoptional platform-dependent frame context; in case of DbgHelp (Windows) should be a pointer to CONTEXT
      [in]theNbTopSkipnumber of traces on top of the stack to skip
      Returns
      TRUE on success

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