Maximum Variable memory? (2D Array)
-
I was hoping to implement a performance enhancement for drawing the mandelbrot set using successive refinement.... This needs an array of integers for each of the pixels on the screen (or actually only a quarter of them, as I can skip the last pass)..
I've tried
array counts_array[gheight()/2][gwidth()/2]
but this results in a "Stack overflow. Too many functions called, maximum memory for variables exceeded" error.... Am I just expecting too much?
-
In its current state, that will just not work due to the memory limitations and the way fuze loosely types variables, more memory is used than just
(gheight()/2 * gwidth()/2 ) * sizeof(int)
There are some considerations we need to take in future versions, but for now the overhead for any variables is too much to be able to achieve this. Sorry about that
-
@MikeDX
no worries... thanks for swift response :) -
@MikeDX So just how much memory are we allowed for variables, arrays, strings, etc? Also as a side-question, how long can strings be?
An interesting idea I just had was that if we were able to access an image's data pixel-by-pixel in a future patch, we could technically use that for storing data. That's how some folks that used Petit Computer handled a large amount of data for their projects, including myself.
edit:
Just did a test. Guess we have at least 4MB available. Started a string with just the character "A", which had a length of 1. Then I threw the string into a for loop to add to itself, so at about 22 iterations, the string was roughly 4,194,304 characters long.