|
-----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Hans Boldt Sent: Thursday, May 20, 2004 9:28 AM To: rpg400-l@xxxxxxxxxxxx Subject: Re: Large Return values (was Re: Variable Length Field Question) >(BTW, improving the performance of large aggregate return values is a >future objective.) Is IBM going to use the method I posted at the beginning of the year on the rpg yahoogroups list? My idea is to add two new features to RPG. one is to auto dealloc a pointer returned from a proc. The 2nd is to let the compiler know what a return pointer points to. The point being, that if the compiler knows a proc is returning a pointer to a varying string: d DatabaseRecordToXml... d pr * varying options(*AutoDealloc) then the compiler can generate the code needed to efficiently copy that return value to the receiver in the calling proc: d XmlString s 9999a varying /free XmlString = DatabaseRecordToXmlString( filename: recordDataStruct ) ; The *AutoDealloc feature would then auto dealloc the return pointer once the call return is completed. here is what I had posted: my suggestion is that a procedure should be able to return a pointer that is auto dealloc once the call return completes. and the proc should also be able to declare what the returned pointer points to, like a varying or null term string: d DatabaseRecordToXml... d pr * varying options(*AutoDealloc) the procedure would then use "alloc" to allocate and build the string. And the rpg compiler would auto run the "dealloc" stmt once the return from the proc call is completed and its return value copied to whereever it is destined: d XmlString s 9999a varying /free XmlString = DatabaseRecordToXmlString( filename: recordDataStruct ) ; // rpg compiler auto deallocs the return pointer right here -Steve Richter
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.