This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with LOC intrinsic for assumed size arrays


Steve Kargl wrote:
> On Wed, Jan 25, 2006 at 05:25:48PM +0100, Paul Thomas wrote:
>>... which is why I think that a library function would do fine. I think 
>>that the overhead of a function call is worth having over an incomplete 
>>transfer intrinsic.
> 
> 
> It isn't a single library function.  You need library functions
> for all possible combinations of types and kind type parameters
> for both SOURCE and MOLD (with and without SIZE).  In one of
> my posts from several months ago, I estimated that we needed 
> something like 168 functions.  Sure, some or all of these
> functions could be autogenerated, but my request for help with
> m4 went unanswered.
> 
> GFC_REAL4 *
> gfc_transfer_r4_r4(GFC_REAL4 *source, GFC_REAL4 *mold, GFC_INTEGER4 *size)
> {
>    if (size) {
>       src = somepackingfunc(source)
>       len = somefuncof(size, sizeof(mold))
>       return ((GFC_REAL4*) memcpy(dst,src,len));
>    } else {
>      yada
>    }
> }

I've not thought through TRANSFER well, but couldn't we use void * together
with a size?  We don't need any type information beyond the size, right?

- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]