[gfortran] Add malloc and free intrinsics

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Oct 29 19:36:00 GMT 2005


On Mon, Sep 26, 2005 at 03:16:39PM +0200, Fran?ois-Xavier Coudert wrote:
> Now that gfortran will support Cray pointers, a useful addition is the
> non-standard MALLOC and FREE intrinsics. They're used on many
> scientific codes to perform dynamic memory allocation.
> 
> Attached patch (independent of the Cray pointers patch, although in
> real life both are used together; I will provide specific testcases
> for their interrelation once the CP patch is in) adds these two
> intrinsics: front-end, library, doc and a testcase.
> 
> I would really welcome comments on the doc part, since I am not a
> native english speaker, and I was not too confident with what should
> be said. Thanks in advance.
> 
> This was built and tested on i686-linux. OK for mainline?

These comments apply to your Round 2 diff, which I somehow
managed to delete (See Paul T I fat finger others emails, too ;-).

The diff for intrinsic.texi is rejected due to a re-ordering
of index entries in my local tree.

In your malloc and free functions, should we add a 
pedantic cast, i.e, malloc((size_t) *size) and 
free((void *) *ptr).  I haven't located docs yet for
malloc.  What is the expected behavior for negative
values?  What happens if malloc(*size) fails and returns
NULL?

-- 
Steve



More information about the Gcc-patches mailing list