Hi all,
I have a problem with QLiberator.
Consider the following program :
100 DEFine PROCedure increase_result_array
110 LOCal dim1,dim2,temparray$(0,0)
120 dim1=DIMN(result$,1)
130 dim2=DIMN(result$,2)
140 DIM temparray$(dim1,dim2)
150 REMark arrcopy result$,temparray$
160 DIM result$(dim1+100,dim2)
170 REMark arrcopy temparray$,result$
180 DIM temparray$(0)
190 END DEFine increase_result_array
200 :
210 DEFine PROCedure p
220 LOCal lp%
230 DIM result$(1,40)
240 FOR lp%=1 TO 90
250 increase_result_array
260 END FOR lp%
270 END DEFine p
280 :
290 p
295 CLS
300 PRINT DIMN(result$,1)
310 kk$=INKEY$(-1)
What is does is call the increase_result_array procedure 90 times. Each
time the result$ array is increased by 100 elements (I've REMmed out the
parts where the old array is copied to a new one and back).
The resulting array will have 9001 elements, 40 chars long each.
When I run this in Sbasic, this Sbasic job occupies about 640 K (240
were already occupied before running the prog, e.g. for the screen etc).
OK, seems normal.
If I compile & execute this, the resulting QLiberated job occupies a
whopping 32 MB!
It seems to me that there is a bug in the variable
allocation/deallocation routines.
Can anybody confirm this? More importantly, does anybody know a way
around this?
Wolfgang
Oh, and,seeing today's date, I hasten to add that this is no joke...
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm