Open CASCADE Technology 7.8.0
|
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>
Public Member Functions | |
Standard_OutOfMemory (const Standard_CString theMessage=0) | |
Constructor is kept public for backward compatibility. | |
Standard_CString | GetMessageString () const override |
Returns error message. | |
void | SetMessageString (const Standard_CString aMessage) override |
Sets error message. | |
Static Public Member Functions | |
static void | Raise (const Standard_CString theMessage="") |
Raises exception with specified message string. | |
static void | Raise (Standard_SStream &theMessage) |
Raises exception with specified message string. | |
static Handle< Standard_OutOfMemory > | NewInstance (Standard_CString theMessage="") |
Returns global instance of exception. | |
static Handle< Standard_OutOfMemory > | NewInstance (Standard_CString theMessage, Standard_CString theStackTrace) |
Returns global instance of exception. | |
Protected Attributes | |
char | myBuffer [1024] |
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:
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 | ( | const Standard_CString | theMessage = 0 | ) |
Constructor is kept public for backward compatibility.
|
override |
Returns error message.
|
static |
Returns global instance of exception.
|
static |
Returns global instance of exception.
|
static |
Raises exception with specified message string.
|
static |
Raises exception with specified message string.
|
override |
Sets error message.
|
protected |