[Mono-list] new operator in C#

Raja R Harinath rharinath@novell.com
Wed, 06 Apr 2005 14:56:19 +0530


Kala B <kalabalun@gmail.com> writes:

> If the C# new operator fails to allocate memory, does it return null?
> ( and throw the OutOfMemoryException). What is the expected/defined
> behaviour ?

According to Section of the standard, it throws an
OutOfMemoryException.  You can find it online in the MSDN C# Language
Specification (it's section there though).


> Is a null check enough ? 

A null check is not necessary.

- Hari