Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Maximum Variable memory? (2D Array)

    Help
    3
    4
    343
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Myddrak
      Myddrak last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • M
        MikeDX last edited by

        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

        Myddrak 1 Reply Last reply Reply Quote 0
        • Myddrak
          Myddrak @MikeDX last edited by

          @MikeDX
          no worries... thanks for swift response :)

          1 Reply Last reply Reply Quote 0
          • Discostew
            Discostew F last edited by Discostew

            @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.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post