Redimming arrays

Blitz3D Forums/Blitz3D Beginners Area/Redimming arrays

Who was John Galt?(Posted 2003) [#1]
If I redim an array at runtime, will it free the memory of the old array of the same name??


Floyd(Posted 2003) [#2]
I would think so, although it's possible Blitz might wait until
the program ends. You could try a test program that does a lot of redimming
and watch the memory usage.

Edit: I just tried this and the WinXP task manager showed memory usage
going up and down slightly as the program did

Dim a( Rand( 5000, 15000 ) )

a hundred times.


Tricky(Posted 2003) [#3]
Perhaps you want to take a look into this thread


Who was John Galt?(Posted 2003) [#4]
OK, so I take it that it does free the mem. I agree its not the best thing in the world to do and I usually avoid it, but it seems a good idea when I load a new tile map (2d array) ocassionally. Ta very much Tric!! :)