What happens if memory allocation fails?

2016-02-20 Thread tcak via Digitalmars-d-learn
This is not easy to try. So I need ask, maybe someone has experienced. What happens if memory allocation fails with "new" keyword? Does it throw an exception? throwable? All I want is to be able to catch OutOfMemory event, and take other steps based on that.

Re: What happens if memory allocation fails?

2016-02-20 Thread Kagamin via Digitalmars-d-learn
Currently it crashes: https://issues.dlang.org/show_bug.cgi?id=1180

Re: What happens if memory allocation fails?

2016-02-20 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 20 February 2016 at 14:21:28 UTC, tcak wrote: What happens if memory allocation fails with "new" keyword? Be aware that memory allocation might never actually fail. It really depends on the operating system. But if it did fail, it would throw OutOfMemoryE

Re: What happens if memory allocation fails?

2016-02-20 Thread Chris Wright via Digitalmars-d-learn
On Sat, 20 Feb 2016 16:58:02 +, Adam D. Ruppe wrote: > On Saturday, 20 February 2016 at 14:21:28 UTC, tcak wrote: >> What happens if memory allocation fails with "new" keyword? > > Be aware that memory allocation might never actually fail. It really > dep