Class OutOfMemoryError - D Programming Language (original) (raw)

Class [core.exception](../../core/exception.html).OutOfMemoryError

Thrown on an out of memory error.

`class OutOfMemoryError
: Error;

`

Fields

Name Type Description
bypassedException Throwable The first Exception which was bypassed when this Error was thrown, or null if no Exceptions were pending.
file string The file name of the D source code corresponding with where the error was thrown from.
info object.Throwable.TraceInfo The stack trace of where the error happened. This is an opaque object that can either be converted to string, or iterated over with foreach to extract the items in the stack trace (as strings).
infoDeallocator nothrow void function(object.Throwable.TraceInfo) If set, this is used to deallocate the TraceInfo on destruction.
line ulong The line number of the D source code corresponding with where the error was thrown from.
msg string A message describing the error.

Properties

Name Type Description
next[get] inout(Throwable)
next[set] Throwable Replace next in chain with tail. Use chainTogether instead if at all possible.

Methods

Name Description
chainTogether (e1, e2) Append e2 to chain of exceptions that starts with e1.
factory (classname) Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor.
message () Get the message describing the error.
opApply (dg) Loop over the chain of Throwables.
opCmp (o) Compare with another Object obj.
opEquals (o) Test whether this is equal to o. The default implementation only compares by identity (using the is operator). Generally, overrides and overloads for opEquals should attempt to compare objects by their contents. A class will most likely want to add an overload that takes your specific type as the argument and does the content comparison. Then you can override this and forward it to your specific typed overload with a cast. Remember to check for null on the typed overload.
refcount ()
toHash () Compute hash function for Object.
toString () Overrides Object.toString and returns the error message. Internally this forwards to the toString overload that takes a sink delegate.
toString (sink) The Throwable hierarchy uses a toString overload that takes asink delegate to avoid GC allocations, which cannot be performed in certain error situations. Override this toString method to customize the error message.

Authors

Sean Kelly and Jonathan M Davis

License

Boost License 1.0.