jms
Member
Hi,
i was wondering if global arrays are just like global variables which dont get memory managed aka cleared, reason is to optimize memory management so i
wonder if there are any reason not to use global arrays.
using local variables and then have GM to handle memory management is from my point of view risky, why do it global variables should mean
GM dont need to do anything. or is the value size "a00" if its changed to larger like "a000000102301020301230" something problematic in detailed level i mean not practical.
reason i ask these is that i developed a software related to an invention back in the days having 1 million size array, each having 32 digits as a value, this took 1 gigabyte ram or more, for 32bit exe it was
somewhere a limit, also i read that max array 1d was 32 000 on the GM site, is that true or is it a recommendation.
manual
Description
With this function you can get the length (number of entries) of a 1D array. For 2D arrays you should be using the array_height_2d and array_length_2d functions.
WARNING!: If the array has over 32,000 entries this function will return an erroneous value and should not be used.
------------------
room1
//create event
global.arr1[0] = "a00"
global.arr1[1] = "a01"
global.arr1[2] = "a02"
room2
//draw gui event
draw_text(333,333,"global arr1:" + string(global.arr1[0] ) )
i was wondering if global arrays are just like global variables which dont get memory managed aka cleared, reason is to optimize memory management so i
wonder if there are any reason not to use global arrays.
using local variables and then have GM to handle memory management is from my point of view risky, why do it global variables should mean
GM dont need to do anything. or is the value size "a00" if its changed to larger like "a000000102301020301230" something problematic in detailed level i mean not practical.
reason i ask these is that i developed a software related to an invention back in the days having 1 million size array, each having 32 digits as a value, this took 1 gigabyte ram or more, for 32bit exe it was
somewhere a limit, also i read that max array 1d was 32 000 on the GM site, is that true or is it a recommendation.
manual
Description
With this function you can get the length (number of entries) of a 1D array. For 2D arrays you should be using the array_height_2d and array_length_2d functions.
WARNING!: If the array has over 32,000 entries this function will return an erroneous value and should not be used.
------------------
room1
//create event
global.arr1[0] = "a00"
global.arr1[1] = "a01"
global.arr1[2] = "a02"
room2
//draw gui event
draw_text(333,333,"global arr1:" + string(global.arr1[0] ) )