× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: List API's, Memory Management, and Pointer Math
  • From: "David Keck" <dkeck@xxxxxxx>
  • Date: Fri, 7 Jul 2000 01:06:04 -0700

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 ...
  1. Create a *USRSPC 100 bytes in length
  2. 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.
  3. Call the QUSPTRUS API to get a pointer to the start of the *USRSPC
  4. 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?
 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.