view lphobos/std/outofmemory.d @ 650:aa6a0b7968f7

Added test case for bug #100 Removed dubious check for not emitting static private global in other modules without access. This should be handled properly somewhere else, it's causing unresolved global errors for stuff that should work (in MiniD)
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 05 Oct 2008 17:28:15 +0200
parents ccca1c13e13a
children 88e23f8c2354
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()
{
    assert(0);
    /*throw cast(OutOfMemoryException)
	  cast(void *)
	  OutOfMemoryException.classinfo.init;*/
}

static this()
{
}