What's the D way of allocating memory?

Dicebot public at dicebot.lv
Thu Aug 8 11:53:01 PDT 2013


On Thursday, 8 August 2013 at 18:35:06 UTC, Gary Willoughby wrote:
> calloc is marked as nothrow but apparently throws 
> OutOfMemoryError on allocation failure? ..eh? O_o

http://dlang.org/function.html
Nothrow Functions:
Nothrow functions do not throw any exceptions derived from class 
Exception.

Error is not Exception (they are both Throwable though), Errors 
are considered non-recoverable and leaving program in invalid 
state. They are allowed even in nothrow functions.


More information about the Digitalmars-d-learn mailing list