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>
|
| | 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.
|
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).
◆ Standard_OutOfMemory()
| Standard_OutOfMemory::Standard_OutOfMemory |
( |
const char *const | theMessage = nullptr | ) |
|
Constructor is kept public for backward compatibility.
- Parameters
-
| theMessage | optional error message |
◆ 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
-
| theMessage | error 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: