[Cython] [cython-users] C++: how to handle failures of 'new'?

Stefan Behnel stefan_ml at behnel.de
Wed Jul 4 14:33:17 CEST 2012


Sturla Molden, 04.07.2012 13:03:
> Den 4. juli 2012 kl. 08:06 skrev Stefan Behnel:
>> Also, the allocation may have failed on a larger block of memory, which is
>> then unused when the exception gets raised and can be used by cleanup code.
>> I really don't think the world is all that dark here.
> 
> Indeed. But how to tell? malloc a small buffer and see if it works?

In the worst case, you'd get another memory error during cleanup and it
would keep rippling up the stack.

Stefan


More information about the cython-devel mailing list