----- Original Message -----
Sent: Friday, July 07, 2000 1:06 AM
Subject: List API's, Memory Management,
and Pointer Math
List API's can dynamically extend the size of
their associated user spaces. I think it unlikely that that
such extensions would always yield a user space consisting of
a contiguous block of bytes in memory. I think it more likely
that extensions would reside in non-contiguous blocks of memory allocated as
extensions become necessary. If my assumption is correct (though I'm
starting to guess that it's not), how then does pointer math work on the list
structures contained in user spaces which are populated by the list API's
?
For Example ...
- Create a *USRSPC 100 bytes in length
- Call a List API which requires a much
larger user space for its results. This should result in an automatic
extension of the size of the user space.
- Call the QUSPTRUS API to get a pointer to the
start of the *USRSPC
- Now for simple pointer math to always work, you
should be able to have the driving RPGIV program work its way through
the entire *USRSPC one byte at a time incrementing the address
(pointer) by 1 until the end of the structure is reached. But if this
always works doesn't that mean that the user space extensions always yield a
*USRSPC which resides in a contiguous block of memory?