Re: Malloc (the most portable way)
From: Tim Prince (tprince_at_nospamcomputer.org)
Date: 11/26/04
- Next message: Ron Shepard: "portable makefiles with f90 modules"
- Previous message: Charles Russell: "Re: g95 wish list"
- Next in thread: Richard Maine: "Re: Malloc (the most portable way)"
- Maybe reply: Richard Maine: "Re: Malloc (the most portable way)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 26 Nov 2004 19:05:04 GMT
"Kaci Tizi Ouzou" <kaci_tizi_ouzou2000@yahoo.ca> wrote in message
news:68599ccc.0411261033.5519f0df@posting.google.com...
> Greetings all,
>
> I am looking for the most portable way to perform a malloc. As far as
> I know, fortran malloc/free is not standard in all fortran compilers.
>
> I was thinking to link fortran code with some C code that takes care
> for the malloc/free task.
That most often means using Cray pointers. Look up the documentation of the
compilers you wish to support which have such a feature. It was the "most
portable" way, prior to f90. There are reasons for Fortran having its own
ways to allocate and free memory, which are portable to any Fortran of the
last 10 years.
Among them: Cray pointers involve finding out which integer types on the
Fortran side work with pointer and size_t types on the C side. There are
several combinations in current use, at least 2 common varieties each for
Windows and linux. There may be more, if people persist in using Cray
pointers in f2003. "Most portable" doesn't measure up to standard.
- Next message: Ron Shepard: "portable makefiles with f90 modules"
- Previous message: Charles Russell: "Re: g95 wish list"
- Next in thread: Richard Maine: "Re: Malloc (the most portable way)"
- Maybe reply: Richard Maine: "Re: Malloc (the most portable way)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|