|
Hi Adam, <snip> I think that for return values to work as they should, then *need* to be created in automatic storage (thanks Eric for the terminology ... I'm not sure if System i people use the PC term "on the heap"). </snip> We System i guys do use the term "on the heap" but I believe automatic variables are allocated on the stack, not the heap. Automatic variables include all non-static variables declared within a subprocedure and all return variables*. Heap variables are simply based on pointers which have memory manually allocated via functions such as %alloc or malloc. * I am assuming that return variables are created on the stack because they do not seem suitable candidates for either static or heap storage, but seem ideally suited for stack storage. Cheers Larry Ducie
As an Amazon Associate we earn from qualifying purchases.
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.