Mercurial > projects > ldc
view lphobos/std/outofmemory.d @ 1194:1853dcd9b944
Moved some DMDFE files into a seperate dmd/root subdir to closer match the DMD file structure since 1.041.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Fri, 03 Apr 2009 17:02:52 +0200 |
parents | 88e23f8c2354 |
children |
line wrap: on
line source
/** * Macros: * WIKI=Phobos/StdOutOfMemory * Copyright: * Placed into public domain. * www.digitalmars.com */ module std.outofmemory; /****** * This exception is thrown when out of memory errors happen. */ class OutOfMemoryException : Exception { static char[] s = "Out of memory"; /** * Default constructor */ this() { super(s); } char[] toString() { return s; } } extern (C) void _d_OutOfMemory() { printf("Out of memory!\n"); *(cast(int*) 0) = 0; throw cast(OutOfMemoryException) cast(void *) OutOfMemoryException.classinfo.init; } static this() { }