[Insight-developers] serious problem with new[] on MSVC++

Charl P. Botha c.p.botha at ewi.tudelft.nl
Thu, 25 Mar 2004 21:46:42 +0100


Miller, James V (Research) wrote:

> On some operating systems, memory allocations never fail. I think this is
> mostly on multi-tiered memory systems.  Basically, the OS assumes that other
> memory will be freed up by the time that you actually access the memory you
> requested.  SGI does this (linux might?). On these systems, the only way to
> know if an allocation for an image failed would be to access every pixel
> after the allocation.

Linux has been critisized for the fact that it over-commits with memory 
allocation.  This concurs precisely with what you say.

However, it seems on windows that the OS is able to report failure on 
allocation (I can supply a test case for this), and in this case I 
believe ITK (or the C++ implementation) should indicate this by raising 
an exception.

Thanks,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/