to get data out of EMS directly and the program will not
do any of that page swapping to conventional memory.
Is that right?{/quote]
Yes you can, but you cannot guarantee that the EMS page will not be switched if you reference other EMS array elements, or some tother EMS-related even occurs, etc. Therefore, the most reliable way to is to copy sections of the virtual array into conventional memory, where you can control it, use pointers, etc. This is my reason for using 32-kbyte strings, which I treat as a collection of BYTE's, etc. By using strings in this way, you can mode large chunks of data between conventional and virtual memory with ease. Of course, if performance is not an issue, just work with the elements directly through the PB RTL.
In your example you get a pointer value outside the loop
( ap = strptr32(a$) ) Can you take a pointer, evaluate
it once to the array start point, and then increment it
yourself in a loop? Will it eventually run into a segment
boundary and become invalid?
( ap = strptr32(a$) ) Can you take a pointer, evaluate
it once to the array start point, and then increment it
yourself in a loop? Will it eventually run into a segment
boundary and become invalid?
In my example, I used a dynamic string to hold a conventional memory copy of the virtual memory data - dynamic strings can only be 32750 bytes or less, and therefore they represent no problem at all.
This is an example of the situation:
TYPE atype
L AS LONG
R AS SINGLE
END TYPE
<snip>
TYPE atype
L AS LONG
R AS SINGLE
END TYPE
<snip>
To get the correct value of VV( ) seems to require
using @PX which is from a VARPTR32( ) evaluated inside the loop
rather than my @PL which comes from incrementing a starting
pointer value.
using @PX which is from a VARPTR32( ) evaluated inside the loop
rather than my @PL which comes from incrementing a starting
pointer value.
In summary: Performance can be had but the price is more code - just like any other programming problem, more code can often result in better performance!
OTOH, if performance is not critical, then don't worry - virtual arrays will work fine as they are!
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment: