@fxm:
Is this statement on https://www.freebasic.net/wiki/TutIntroArrays correct?
"Static arrays, the arrays described above, are kept on the heap, but dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the requested dimensions of the array."
I thought incorrect, but I may have misunderstood the 'heap'.
Wiki improvements
Re: Wiki improvements
In the context of this sentence, I think that 'static arrays' means 'fixed-length arrays' and therefore that this beginning of the sentence is wrong.
I simply propose to delete the beginning of the sentence:
I simply propose to delete the beginning of the sentence:
or correct it:Dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the requested dimensions of the array.
Static (fixed-length) arrays, the arrays described above, are kept either in static storage or on the program stack, but dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the requested dimensions of the array.
Last edited by fxm on Jan 24, 2025 6:08, edited 1 time in total.
Reason: Complemented post.
Reason: Complemented post.
Re: Wiki improvements
The first (with less information) seems better to me.
In both suggestions the reference to heap is gone, but in the second 'static storage or program stack' is now mentioned which is confusing if we don't explain the difference between these 2 concepts.
Maybe add a link to https://www.freebasic.net/wiki/ProPgDynamicMemory where this is better explained?
In both suggestions the reference to heap is gone, but in the second 'static storage or program stack' is now mentioned which is confusing if we don't explain the difference between these 2 concepts.
Maybe add a link to https://www.freebasic.net/wiki/ProPgDynamicMemory where this is better explained?
Re: Wiki improvements
Retained sentence:
Documentation updated:
TutIntroArrays → fxm [rewording]
Dynamic arrays are allocated from the computer's pool of memory called heap. The compiler dynamically allocates memory for the array based on the requested dimensions of the array.
Documentation updated:
TutIntroArrays → fxm [rewording]