OCCT3D 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_OutOfMemory Class Reference

    Standard_OutOfMemory exception is defined explicitly and not by macro DEFINE_STANDARD_EXCEPTION, to avoid necessity of dynamic memory allocations during throwing and stack unwinding: More...

    #include <Standard_OutOfMemory.hxx>

    Inheritance diagram for Standard_OutOfMemory:

    Public Member Functions

     Standard_OutOfMemory (const char *const theMessage=nullptr)
     Constructor is kept public for backward compatibility.
    const char * what () const noexcept override
     Returns error message (implements std::exception interface).
    const char * ExceptionType () const noexcept override
     Returns the exception type name.
    void SetMessageString (const char *const theMessage)
     Sets error message.

    Detailed Description

    Standard_OutOfMemory exception is defined explicitly and not by macro DEFINE_STANDARD_EXCEPTION, to avoid necessity of dynamic memory allocations during throwing and stack unwinding:

    • message string is stored as field, not allocated dynamically (storable message length is limited by buffer size)

    The reason is that in out-of-memory condition any memory allocation can fail, thus use of operator new for allocation of new exception instance is dangerous (can cause recursion until stack overflow, see #24836).

    Constructor & Destructor Documentation

    ◆ Standard_OutOfMemory()

    Standard_OutOfMemory::Standard_OutOfMemory ( const char *const theMessage = nullptr)

    Constructor is kept public for backward compatibility.

    Parameters
    theMessageoptional error message

    Member Function Documentation

    ◆ ExceptionType()

    const char * Standard_OutOfMemory::ExceptionType ( ) const
    inlineoverridenoexcept

    Returns the exception type name.

    ◆ SetMessageString()

    void Standard_OutOfMemory::SetMessageString ( const char *const theMessage)

    Sets error message.

    Parameters
    theMessageerror message (can be nullptr)

    ◆ what()

    const char * Standard_OutOfMemory::what ( ) const
    overridenoexcept

    Returns error message (implements std::exception interface).


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