|
Hi Barbara - >Ken, what you say may be true of some system allocation >functions (I think the C runtime's realloc might work >this way), but not all, and not the one that RPG uses >under the covers. First, RPG always returns a different >pointer from a successful REALLOC, and second, the storage >isn't necessarily allocated in 4K chunks. The program >below displays 32. Oops, I was confusing the create and extension sizes of the heap as a whole with the size of the allocation and reallocation. > First, RPG always returns a different >pointer from a successful REALLOC, Some testing confirms that is true, even when the storage always be extended in place because the additional storage is within the 16-byte boundary minimum. Obviously the heap processing code could use some fine tuning. (I'm assuming that the compiler is generating calls to heap storage management, not managing the storage directly, so I'm not blaming you and Hans. <G>) >The program below displays 32. Obviously the heap control storage is taken out of the heap itself, accounting for the additional 16 bytes per allocation. Ken Southern Wine and Spirits of Nevada, Inc. Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.