× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Even more efficient is to simply load the parameter value to a register and have the called function use the value, in the register, as is.  The backend (not the compilers per se) will, for some parameter types, do this form of optimization under the covers.

Bruce
Bruce Vining Services
507-206-4178

--- On Thu, 1/29/09, Adam Glauser <adamglauser@xxxxxxxxx> wrote:

From: Adam Glauser <adamglauser@xxxxxxxxx>
Subject: Re: How parameters are passed.
To: rpg400-l@xxxxxxxxxxxx
Date: Thursday, January 29, 2009, 8:45 AM

Alan Campin wrote:
Obviously it is a lot more efficient to push the integer on the stack
(4 bytes) instead of creating a work variable, copy the value to it,
get a pointer and push pointer onto the stack (16 bytes) and then
throw away when done.

IIRC, Barbara has stated in the past that work variables may be reused
for different operations in certain circumstances. So, FWIW, the
compiler may not always need to allocate memory in the case you describe.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.