[Patch, fortran] PR28105 Overflow check for memory allocation

Steve Kargl sgk@troutmask.apl.washington.edu
Wed Dec 15 16:20:00 GMT 2010


On Wed, Dec 15, 2010 at 12:18:16PM +0200, Janne Blomqvist wrote:
> 
> OTOH since we're calling _gfortran_os_error which calls perror() we
> get the same message twice just worded slightly differently. E.g.
> 
> $ ./largealloc
> Operating system error: Cannot allocate memory
> Out of memory
> 
> which is a bit redundant. So maybe just an empty string (or NULL)
> is sufficient?
> 

In the above, how about changing "Out of memory" to 
"Allocation would exceed system or user memory limit".
Thus, one would get 

$ ./largealloc
Operating system error: Cannot allocate memory
Allocation would exceed system or user memory limit

Second, provides a hint to user where to look for 
the problem.  Whatever you decide is fine with me.

-- 
Steve



More information about the Fortran mailing list