From: laz@walleye.gonefishing.sk.ca (Larry Zimmerman)
Subject: Re: A Fortran/C code malloc problem
Date: 1999/03/25 [thread overview]
Message-ID: <36fb216f.0@204.83.142.253> (raw)
In-Reply-To: 7d9vrc$clg$1@nnrp1.dejanews.com
In article <7d9vrc$clg$1@nnrp1.dejanews.com>,
b_duke@my-dejanews.com writes:
>I have been struggling for some weeks with the port of an established
>program to Alpha linux. It is a fortran code that calls a small
>amount of C which in turn calls malloc to allocate dynamic memory.
>The code below isolates the problem from the main program. It
> Program TEST
..
> LOFFS2 = (LOFFS1+7)/8 + 1
You might want to try using I*8 variables instead of constants.
I have found problems with mixed size aritmetic.
>with this C linked in:-
>
>long memget_(nwords) long *nwords;
> { unsigned int nbytes;
I think you should declare nbytes as long or size_t.
>The problem is that the number returned by malloc is far too
>large giving an offset from X(1) that is far too large. It is
This was discussed on the redhat alpha list. The problem is that
small amounts of memory are allocated in one place, and larger
amounts are allocated at a higher address that is not contiguous
with the rest of the program.
>I would welcome any assistence.
I have a similar scheme that seems to work for me. Check out:
http://walleye.gonefishing.sk.ca click on the linux tidbits,
then look for the g77 link. If this is useful to you, feel free
to copy, use, modify it.
Larry Z.
--
signature withheld pending a patent/copyright search.
prev parent reply other threads:[~1999-03-25 5:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-24 5:00 A Fortran/C code malloc problem b_duke
1999-03-24 5:00 ` Robert Harley
1999-03-25 5:00 ` b_duke
1999-03-25 5:00 ` Greg Lindahl
1999-03-25 5:00 ` Larry Zimmerman [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox