Re: Parameter passing in PV-Wave [message #7386] |
Wed, 06 November 1996 00:00 |
peter
Messages: 80 Registered: February 1994
|
Member |
|
|
Bob Fletcher (Bob.Fletcher@ae.ge.com) wrote:
: I'm trying to understand the parameter passing in Wave.
: In the programers manual it says
Now there's your first mistake, reading the manual :)
: 1: 'Variables are passed by reference.' (P. 241)
: On page 242 it says: (bullet 5)
: 2: 'values of parmeters passed by reference are _copied back
: into corresponding variables_'
: and I only have to store the big array once. The pass by reference
: just passes the address of a, and the subroutine just finds the right
: memory location and does it's thing. (which allows all those ugly
: fortran cheats passing parts of multidim. arrays.)
: If I do this in Wave what happens? Quote 1: makes me think
: that it's like fortran, but quote 2: makes me think that I have to
: copy the whole array into a separate memory location. ( Bad thing )
The right thing happens, nothing is copied (test by checking the memory
allocated to the process, allocate something big, then pass it to a
function). This section of the manual is horribly written, but hasn't
changed in several years.
: The more general question is, what are the preformance penalties of
: calling functions and procedures. (And does the compiler do anything
: smart. Inlining for instance?)
Good question! Any of our regular performance testers want to take this
one?
Peter
|
|
|