On Friday, May 10, 2019 11:54:44 AM MDT H. S. Teoh via Digitalmars-d-learn 
wrote:
> On Fri, May 10, 2019 at 05:32:25PM +0000, faissaloo via Digitalmars-d-
learn wrote:
> > On Friday, 10 May 2019 at 12:19:29 UTC, Cym13 wrote:
> > > On Friday, 10 May 2019 at 10:11:51 UTC, faissaloo wrote:
> > > > My program contains the following statement:
> > > >     auto newChildNode = new Node();
> > > >
> > > > In debugging I have found that this pointer evaluates to null,
> > > > what could cause this? I should have plenty of memory, my only
> > > > other idea is some sort of heap corruption.
> > >
> > > Could you share a complete, concise, compilable example
> > > demonstrating that bug? One line is rather short to understand
> > > what's happening.
> >
> > Unfortunately not, I can't seem to reproduce it outside my codebase.
>
> Perhaps try Dustmite on it?
>
> AFAIK, calling new on a struct should never return null. So there must
> be something else not quite right here.  But without actual code it's
> anybody's guess as to what it might be.

If the GC fails to allocate, it will throw an OutOfMemoryError. So, new
should never return null. I have no clue what could be happening in this
case.

- Jonathan M Davis



Reply via email to