Isn't that the main reason to use a "stack" of DSA's as LE does for multiple language implementations? No GETMAIN needed until you run out of "stack", just update "next available byte" pointer in the stack.
Peter From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Richard Zierdt Sent: Friday, March 28, 2025 11:49 AM To: [email protected] Subject: Reentrant Lite ? When coding reentrant modules, one practice is to Obtain Storage (Getmain, etc) and setup shop. This is well and good. But another technique would have the *caller*, who may be reentrant or not, *provide* the savearea / workarea and pass the address of that area through typical R1 / address list linkage stuff. This would save Obtain / Getmain / Freemain calls. For a program that gets called thousands of times, the overhead would add up. Yes, the caller has to provide a workarea, and that may cost one Getmain, but it's only once. Say Program A calls reentrant Program B 10,000 times. If A provides the workarea, that saves 10,000 Getmain/Freemains in B. The concept seems to be used by the IEAMSXMP "POST" macro, which wants a 512-byte WORKAREA=. Well, why not get it yourself, IBM? Answer might be to save overhead. (Yes, there may be other reasons). Any program could be reentrant without Getmains if callers provided save/work areas (and the programs were written accordingly). Just a thought Richard Zierdt -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
