I have a question about freeing up memory from an array.
Situation: You have an array that contains information valid for a single turn only (say 12 values). The next turn you want to put new information in the array, but you do not have as many values to put into the array as you did last turn (say 8 values). You reinitialize the array so that all the old values are replaced with 0, then put the new values into the array. You request the size of the array and CTP2 tells you the size of the array is 12, because you have simply replaced the 12 values in the first run with 0's. To get an accurate count of the size of the array, you have to subtract the number of slots with 0s in them from the size of the array.
Is there a way in SLIC to tell CTP2 to release the unused portion of the array, so you can get an accurate reading of the size of the array without the need for an equation?
Or, once memory has been allocated for an array, that array remains the same size whether you need that information or not?
Situation: You have an array that contains information valid for a single turn only (say 12 values). The next turn you want to put new information in the array, but you do not have as many values to put into the array as you did last turn (say 8 values). You reinitialize the array so that all the old values are replaced with 0, then put the new values into the array. You request the size of the array and CTP2 tells you the size of the array is 12, because you have simply replaced the 12 values in the first run with 0's. To get an accurate count of the size of the array, you have to subtract the number of slots with 0s in them from the size of the array.
Is there a way in SLIC to tell CTP2 to release the unused portion of the array, so you can get an accurate reading of the size of the array without the need for an equation?
Or, once memory has been allocated for an array, that array remains the same size whether you need that information or not?
Comment