× 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: Re: List API's, Memory Management, and Pointer Math
  • From: "Eric N. Wilson" <doulos1@xxxxxxxx>
  • Date: Thu, 6 Jul 2000 22:51:02 -0700


______________________________________________
Eric N. Wilson
President
Doulos Software & Computer Services
2913 N Alder St.
Tacoma WA 98407
> List API's can dynamically extend the size of their associated user
spaces...how then does pointer math work on
> the list structures contained in user spaces which are populated by the
list API's ?

Suffice it to say the pointer math works. Whether this is done my
reshuffling memory/disk or by some fancy footwork under the covers is
anyones guess.

It could work similar to REALLOC on other systems I know. If there is no
room to extend the memory contiguously the whole structure is copied to a
new area of memory and the old area is freed. Then the rest of the heap can
be compacted so that the next ALLOC or REALLOC has a better chance of not
having to copy the entire structure but rather just taking more of the spare
bytes off the heap.

Since you are calling the get pointer routine after the creation and
extention then the address could be known no matter what.


However if you were to call the QUSPTRUS right after the initial creation of
the user space then they may use double indirection to get the user space's
real address ( The QUSPTRUS could be giving an address to a pointer that
points to the first byte of the user space). My father always told me that
there was no problem that could not be solved with another level of
indirection :-)

HTH
Eric

+---
| 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 thread ...

Replies:

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.