Memory / Code / Array Limits?
Blitz3D Forums/Blitz3D Beginners Area/Memory / Code / Array Limits?
| ||
Is there a limit to the size of Arrays in BlitzPlus and Blitz3D? How about a limit to the size of Code? Also, any limits to the number of dynamic objects (ie: Type, New, Delete commands)? I'm planning to make a game which contains a very large array (like 1024x1024 array of Integers) and I wanted to make sure BlitzPlus and/or Blitz3D could handle this before I do too much work on the project! (I've been "burned" in the past by other programming languages which either outright do not support an array this large, or appear to support a large array like this and then crash or behave irratically when you fill it with Data... Hours of work for nothing! I don't want to repeat this experience by trying to make the game in Blitz if Blitz isn't going to support it. Same thing with Code, I'd get the game like 75% done and then get some silly error like "Compiler doesn't support Code Block Sizes over 64k") Thanks in advance! |
| ||
"Same thing with Code, I'd get the game like 75% done and then get some silly error like "Compiler doesn't support Code Block Sizes over 64k") " blitz does :) I think its a limit based on the actual memory of the system for your other query. |
| ||
If I remember right, there is a limit on the number of lines of code that the Blitz IDE can handle (but I don't remember what it is, maybe something like 50,000 lines or something), but this can be worked around with INCLUDEs (where you place blocks of code in seperate files and load them in) and if necessary, a third party IDE. |
| ||
As if anyone can keep a clear overview with 50.000 lines in one file :) |
| ||
And there was a limit of global variables (something really high). Search the Bug Reports forum, I think. There were workarounds, too. |
| ||
If you ever doubt, try making a test programDim large(99999,99999) For a=0 to 99999 For b=0 to 99999 large(b,a)=1 Next Next Should give you an idea of what Blitz and your computer can handle. |
| ||
Globals can be put in arrays for one. const lifeplayer = 0 dim gs(100) if gs(lifeplayer) < 0 then playerdeath() Makes saving your globals easy to. With a editor that support folding you can easily make 50000 lines managable. I have had numerous experiences of lack of memory while defining arrays. So you can be certain they can be defined to the max. |