Parameter passing in PV-Wave [message #7398] |
Mon, 04 November 1996 00:00 |
Bob Fletcher
Messages: 1 Registered: November 1996
|
Junior Member |
|
|
I'm trying to understand the parameter passing in Wave.
In the programers manual it says
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_'
So what realy happens.
In fortran call by reference I can say
REAL a(10000000000)
call addit(a)
....
subroutine addit(b) PRO, addit,b
b(99999999) = b(99999999)+1 b(99999999) = b(99999999)+1
return RETURN
end end
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 )
Do I end up storing A twice? Does it depend on the variable type of
a? ( List? assoc array? structure?)
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?)
Any ideas?
Bob.
_________________________________________________
Bob Fletcher,
GEAE Analysis Systems
1 Neumann Way, M/D 207
Cincinnati OH 45215-6301
Bob.Fletcher@ae.ge.com
|
|
|